Bitbucket 10.x file editor crashes instead of disabling Edit button when file contains a line longer than page.max.source.length

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Low
    • None
    • Affects Version/s: 10.0.0, 10.2.0, 10.1.5, 10.2.3
    • Component/s: UI
    • None
    • 1
    • Severity 3 - Minor
    • 1

      Issue Summary

      Environment / Versions Tested: Bitbucket Data Center 10.0.0, 10.2.0, 10.2.3
      Not reproduced in: Bitbucket Data Center 9.6.5 — Edit button is disabled as expected

      Steps to Reproduce

      1. Use a Bitbucket instance with default page.max.source.length value, or any configured value.
      2. Create or open a repository file that contains a single line longer than the configured page.max.source.length value. Default threshold is 5000 characters. Example: create a text/YAML file with one line containing 5002+ characters.
      3. Browse to the file in Bitbucket Source View and Click the Edit button.
      4. Observe the page/editor behavior and browser console.

      Expected Results

      Bitbucket should disable the Edit button when the file contains a line longer than page.max.source.length. The UI should show/indicate This file is too large to edit. This matches the behavior in Bitbucket 9.6.5 and the documented KB behavior.

      Actual Results

      In Bitbucket 10.x, the Edit action is available. When clicked, the editor/page fails with a browser JavaScript error:

      TypeError: e.editing.changes is not a function
      

      The page may show: This page couldn't be displayed. Refer to the image below:

      Workaround

      Increase the configured line-length limit in $BITBUCKET_HOME/shared/bitbucket.properties
      For example:

      page.max.source.length=10000
      

      Then restart Bitbucket. Please note that increasing this value can have some CPU/memory impact, especially for very large files or very long lines, so we recommend setting it only as high as needed.

              Assignee:
              Unassigned
              Reporter:
              Priyata Waje
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: