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 interleaving of save/sync operations #10166

Merged
merged 1 commit into from
Sep 9, 2024

Conversation

riknoll
Copy link
Member

@riknoll riknoll commented Sep 9, 2024

fixes microsoft/pxt-microbit#5926

this fixes a bug caused by interleaving save/sync operations when duplicating a project from within the code editor.

we maintain a global array of all the available headers in the current workspace that we pull projects from. currently, that array gets updated in two places:

  1. when we do a sync operation
  2. when we start to save a new project (but before the project is actually saved)

if a sync operation gets triggered after we start saving a new project but before that save has actually completed, it can accidentally overwrite the change that was made when we saved a new project.

luckily, it's an easy fix. we just need to wait to add the project to the header array until after it's actually saved.

@riknoll riknoll requested a review from a team September 9, 2024 19:21
Copy link
Contributor

@srietkerk srietkerk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@riknoll riknoll merged commit 09cbe2b into master Sep 9, 2024
7 checks passed
@riknoll riknoll deleted the dev/riknoll/headers-all-settled2 branch September 9, 2024 23:42
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.

Version History: Saving a copy doesn't show up in your projects automatically
2 participants