Skip to content

Conversation

fw-bot
Copy link
Contributor

@fw-bot fw-bot commented Mar 14, 2025

Have a many2many_tags field, in a form view for instance, with multiple tags. Focus its input, and then quickly press Backspace multiple times. Before this commit, there were 2 problems.

First, if there was an onchange on that field, the onchange was triggered multiple times with the same forget command, especially on a slow-ish network.

Second, there could be a crash, but to reproduce it the timing had to be precise: backspace should have been pressed when a previous tag deletion was already processed by the model (i.e. the tag is no longer in the list), but the DOM wasn't updated yet. This could be done more easily then it sounds, by quickly pressing backspace on a many2many_tags with a lot of tags.

The related opw is about the second issue, as the first one isn't obversable functionally. However, testing the second one is really tricky, even impossible without going white-box. We thus wrote a test for the first issue only, as the fix for both is actually the same.

opw-4596936

Forward-Port-Of: #201667
Forward-Port-Of: #201164

Have a many2many_tags field, in a form view for instance, with
multiple tags. Focus its input, and then quickly press `Backspace`
multiple times. Before this commit, there were 2 problems.

First, if there was an onchange on that field, the onchange was
triggered multiple times with the same forget command, especially
on a slow-ish network.

Second, there could be a crash, but to reproduce it the timing had
to be precise: backspace should have been pressed when a previous
tag deletion was already processed by the model (i.e. the tag is
no longer in the list), but the DOM wasn't updated yet. This could
be done more easily then it sounds, by quickly pressing backspace
on a many2many_tags with a lot of tags.

The related opw is about the second issue, as the first one isn't
obversable functionally. However, testing the second one is really
tricky, even impossible without going white-box. We thus wrote a
test for the first issue only, as the fix for both is actually the
same.

opw-4596936

X-original-commit: e50e86a
@robodoo
Copy link
Contributor

robodoo commented Mar 14, 2025

Pull request status dashboard

@robodoo robodoo added the forwardport This PR was created by @fw-bot label Mar 14, 2025
@fw-bot
Copy link
Contributor Author

fw-bot commented Mar 14, 2025

This PR targets saas-18.2 and is part of the forward-port chain. Further PRs will be created up to master.

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@C3POdoo C3POdoo added the OE the report is linked to a support ticket (opw-...) label Mar 14, 2025
@fw-bot
Copy link
Contributor Author

fw-bot commented Mar 14, 2025

@aab-odoo @jpp-odoo the next pull request (#201830) is in conflict. You can merge the chain up to here by saying

@robodoo r+

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@aab-odoo
Copy link
Contributor

@robodoo r+

robodoo pushed a commit that referenced this pull request Mar 14, 2025
Have a many2many_tags field, in a form view for instance, with
multiple tags. Focus its input, and then quickly press `Backspace`
multiple times. Before this commit, there were 2 problems.

First, if there was an onchange on that field, the onchange was
triggered multiple times with the same forget command, especially
on a slow-ish network.

Second, there could be a crash, but to reproduce it the timing had
to be precise: backspace should have been pressed when a previous
tag deletion was already processed by the model (i.e. the tag is
no longer in the list), but the DOM wasn't updated yet. This could
be done more easily then it sounds, by quickly pressing backspace
on a many2many_tags with a lot of tags.

The related opw is about the second issue, as the first one isn't
obversable functionally. However, testing the second one is really
tricky, even impossible without going white-box. We thus wrote a
test for the first issue only, as the fix for both is actually the
same.

opw-4596936

closes #201805

X-original-commit: e50e86a
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
@robodoo robodoo closed this Mar 14, 2025
@fw-bot fw-bot deleted the saas-18.2-17.0-m2m-tags-fix-aab-422771-fw branch March 21, 2025 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

forwardport This PR was created by @fw-bot OE the report is linked to a support ticket (opw-...)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants