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: unexpected file changes when editing #2786

Merged
merged 16 commits into from
Apr 30, 2020

Conversation

zhixzhan
Copy link
Contributor

@zhixzhan zhixzhan commented Apr 27, 2020

Description

Issue #2748 is when editing, the concurrency bug in reformat methods
After some refactor by plugins PR #2023, getProjectById is called at very high frequency. And every getProjectById() --> Project.index() , and inside it some reformat methods executed would travels all files do reformat. When called in concurrency it produced a write bug.

By re-using an indexed project instead of call index() everytime we could avoid this type problem and improve performance.

Issue #2793 is when delete a dialog, the concurrency bug in removeFile methods.
this.files is not updated immediately.

Task Item

close #2748
close #2793

Screenshots

@zhixzhan
Copy link
Contributor Author

Nowadays, client handle most changes in local, so after first load, we also do not need server index anymore.

@zhixzhan zhixzhan requested a review from lei9444 April 27, 2020 11:53
@zhixzhan zhixzhan changed the title use cached projects fix: unexpected file changes when editing Apr 27, 2020
@zhixzhan zhixzhan requested a review from srinaath as a code owner April 28, 2020 07:27
@github-actions
Copy link

Coverage Status

Coverage remained the same at 0.0% when pulling 51d78a2 on zhixzhan:open-project-fix into fe192c6 on microsoft:master.

@a-b-r-o-w-n a-b-r-o-w-n merged commit 6d14ac5 into microsoft:master Apr 30, 2020
@zhixzhan zhixzhan deleted the open-project-fix branch May 6, 2020 02:00
@zhixzhan
Copy link
Contributor Author

zhixzhan commented May 7, 2020

Nowadays, client handle most changes in local, so after first load, we also do not need server index anymore.

Note for a special case.

If some changes are made in current opened bot , not via Composer, e.g

delete a dialog from local file system,
write file via my text editor,

the Composer wouldn't receive this changes. Cause this PR let Composer server use indexed project.

To make Composer sync with external file change, user need to re-open current project force trigger a server index.

lei9444 pushed a commit to lei9444/BotFramework-Composer-1 that referenced this pull request Jun 15, 2021
* use cached projects

* don't need to call init after project loaded

* use a real-time refreshed files list, fix concurrency deletes

* update test

* create/saveAs/open project should call init

* clean up

* update

Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>
Co-authored-by: Ben Yackley <61990921+beyackle@users.noreply.github.com>
Co-authored-by: Andy Brown <asbrown002@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants