[PM-17912] Sync vault when saving an item #13212
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ποΈ Tracking
#12022
π Objective
This syncs the vault after an item is saved, as a workaround for the bug where saved items do not show the changes that were made until some action is taken to "refresh" the view of the item.
This is almost certainly the wrong way to fix the bug, but I wanted to demonstrate a workaround to get more visibility on this issue and prompt further discussion on what the real solution might be.
I copied the
await this.syncService.fullSync(true, true)
line fromapps/desktop/src/app/app.component.ts#L355
, and did not preserve the try/catch behavior. Also note that if you scroll up in that file you'll see aDEPRECATED
comment that warnsPlease do not use the AppComponent to send events between services
, so even if syncing on item save is the correct solution for this bug, I'm probably doing it the wrong way.Also note that with this workaround, there is still a delay after saving the item in which the old state is displayed before the vault finishes syncing, at which point the item changes to show the new state.