Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-8315

Bitbucket Server interprets Objective-C file as Mathematica file <Uncaught Error: Mode mathematica failed to advance stream.>

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Low
    • None
    • 4.2.1
    • None

    Description

      Summary

      User created a pull request for a branch that contained Objective-C file with the .m file extension.

      In the diff view of the pull request the file preview is blank.

      Viewing the page with chrome devtools this is seen in the error console:

      Uncaught Error: Mode mathematica failed to advance stream.

      Steps to reproduce

      1. Add, commit and push a file with a .m extension that includes a special character like ©.

      Example source code to use for testing:

      //
      //  Words
      //  Words
      //
      //  Words
      //  Words © 
      //
      
      1. Check source view for the file.
      2. Create pull request and check file preview in diff view

      Expected Results

      The file's contents should be displayed.

      Actual Results

      In Chrome the file contents are seen briefly before disappearing.
      In Firefox the view is just blank.

      WorkAround

      As per this reference Bitbucket Server can be told to regard files with the .m file extension as Objective-C files.

      In this case the following was added to the $BITBUCKET_HOME/shared/bitbucket.properties file:

      syntax.highlighter.text/x-objectivec.extensions=m

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              nhansberry Nate Hansberry
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: