-
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
- When a file contains a single line longer than the configured page.max.source.length limit, Bitbucket 10.x allows the user to enter the edit flow, but the browser/editor crashes with a JavaScript error.
- This appears to be a regression from Bitbucket 9.6.5, where the same scenario behaves as expected and the Edit button is disabled with the “This file is too large to edit” message.
- The documented expected behavior is described in the KB:
https://support.atlassian.com/bitbucket-data-center/kb/the-edit-button-is-disabled-in-the-source-view-of-bitbucket-datacenter-ui/
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
- Use a Bitbucket instance with default page.max.source.length value, or any configured value.
- 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.
- Browse to the file in Bitbucket Source View and Click the Edit button.
- 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.