Tuesday, October 31, 2023
1 change · 17.0
Resolved issues and error corrections
This update fixes a critical issue in Knowledge where multiple users editing articles simultaneously could lose changes without warning. The fix ensures that when one user saves changes while another user hasn't synced their edits, the system detects this conflict and prevents data loss. Additionally, it stops unnecessary data from accumulating in article files after each save, improving system performance.
Original PR description
Collaborative html_field should all use `handle_history_divergence` during `write`, to ensure that someone cannot save content if another user saved and they did not sync their change together (diverging steps would overwrite previously saved changes without informing the user). See [1]. Without this fix, the `data-last-history-steps` attribute of the first node in the article body would grow indefinitely after each write. After this fix, only the required id is kept. [1]: https://github.com/odoo/odoo/pull/112099 When writing on articles created from a template, encode the string in `unicode` as `handle_history_divergence` does a regex on the body value and it does not work with `bytes`. task-3572449 Forward-Port-Of: odoo/enterprise#49647