-
- Downloads
[FIX] web: truncate filename when importing custom module via studio
Issue:
When uploading a large custom module via studio for importing, Chrome
crashes with an internal SIGKILL and Firefox manages to load, but is
really sluggish.
Steps to reproduce:
- Install Studio
- In the Apps Dashboard > Customizations > Import
- Upload a large custom module (50 MiB)
- Chrome crashes, while on Firefox the page is sluggish
Cause:
In the module `base_import_module`, the `module_file` doesn't have a
corresponding `filename`, therefor the name used to be displayed in
the wizard is the content of the binary file in base64 encoding...
For a module that is of a large size, this is a *gigantic* string
that crashes Chrome and slows down the DOM on Firefox.
Fix:
Truncate the maximum filename that is displayed in the template to
the max length necessary to encode in base64 (0xFF) 255 bytes, as
255 bytes is the maximum filename size on Linux/Windows/MacOS.
Affected versions:
16.0 up to master
Reference:
opw-3491998
closes odoo/odoo#134165
Signed-off-by:
Aaron Bohy (aab) <aab@odoo.com>
Showing
- addons/web/static/src/core/utils/binary.js 9 additions, 0 deletionsaddons/web/static/src/core/utils/binary.js
- addons/web/static/src/views/fields/binary/binary_field.js 5 additions, 2 deletionsaddons/web/static/src/views/fields/binary/binary_field.js
- addons/web/static/tests/views/fields/binary_field_tests.js 24 additions, 0 deletionsaddons/web/static/tests/views/fields/binary_field_tests.js
Please register or sign in to comment