Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Visual Editor] Fix a race condition between update AST and save change events #240

Merged
merged 1 commit into from
Sep 11, 2024

Conversation

leandrocp
Copy link
Contributor

@leandrocp leandrocp commented Sep 11, 2024

Fix a race condition between updating the AST from client/server and saving the changes made on the template.

Since we have 2 distinct events: one to update the AST and another to actually save the changes, on an env with high latency when one makes a change on the visual editor and hit Save Change there could a race condition that would save the old template because it wasn't updated yet.

So we need to use another assign that is guaranteed to be updated before the save event actually happens.

Close #226

and saving the changes made on the template.

Since we have 2 distinct events: one to update the AST and another
to actually save the changes, on an env with high latency
when one makes a change on the visual editor and hit Save Change
there could a race condition that would save the old template
because it wasn't updated yet.

So we need to use another assign that is guaranteed to be updated
before the save event actually happens.
@leandrocp leandrocp changed the title Fix a race condition between updating the AST from client/server [Visual Editor] Fix a race condition between update AST and save change events Sep 11, 2024
@leandrocp leandrocp merged commit 7524da9 into main Sep 11, 2024
3 checks passed
@leandrocp leandrocp deleted the lp-fix-226 branch September 11, 2024 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failing to save changes after making changes on the visual editor
1 participant