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

fix(plugin-history-sync): avoid race conditions by chaining promises #410

Merged
merged 16 commits into from
Sep 14, 2023

Conversation

orionmiz
Copy link
Member

@orionmiz orionmiz commented Sep 6, 2023

Closes: #381

There is currently an issue with queue function where all callbacks are waiting for one and the same callback listening history change, rather than the callback that ran just before it.

This PR solves the issue by making callbacks into promises and chaining them to be executed sequentially.

Also, PromiseProxy was introduced to set delay for the actions as memory histories became to be changed explicitly asynchronous in the tests.

@vercel
Copy link

vercel bot commented Sep 6, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
stackflow-docs ✅ Ready (Inspect) Visit Preview Sep 14, 2023 3:25am

@orionmiz orionmiz changed the title test: add failing test fix(plugin-history-sync): avoid race conditions with promise chaining Sep 10, 2023
@orionmiz orionmiz changed the title fix(plugin-history-sync): avoid race conditions with promise chaining fix(plugin-history-sync): avoid race conditions by chaining promises Sep 10, 2023
@orionmiz orionmiz merged commit 0cae5aa into main Sep 14, 2023
3 checks passed
@orionmiz orionmiz deleted the pop-replace branch September 14, 2023 16:13
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.

Bug report(history-sync): Pop multiple and replace screen trigger history sync error.
2 participants