fix: incorrect saving logic after duplicated slide#163
Merged
GursheenK merged 3 commits intofrappe:developfrom Apr 13, 2026
Merged
fix: incorrect saving logic after duplicated slide#163GursheenK merged 3 commits intofrappe:developfrom
GursheenK merged 3 commits intofrappe:developfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixed infinite autosave loop and slide loss caused by duplicating slides one after the other due to name getting defined as undefined instead of name being an empty string, which was checked to evaluate the dirty flag in consecutive saves and led to an incorrect dirty value.
getNewSlideassignsname: ''to newly added slide.isDirtybecomes true and save triggers.updateNewlyAddedSlideUUIDsruns but at this point there are three slides - the original slide, the first duplicated slide and the second duplicated slide but the very first save call only had 2 slides to save so its response does not have the third slide at all sopresentationResource.value.doc.slides[idx]?.nameis undefined for the third slide and is assigned to the name key by the first save call.updateNewlyAddedSlideUUIDsruns again but at that point the third slide name is undefined and not''so the newly returned name is not updated.presentationDoc.value = presentationResource.value.docruns but now presentationDoc.slides[2].name = 'real-uuid' (from the second save response which had all 3 slides).isDirtycompares original[2].name = 'real-uuid' vs current[2].name = undefined. hasSlideChanged hits slideState.name != '' && slideState.name != originalState.name — undefined != '' is true → dirty forever. Every iteration destroys the server's slide row and creates a new one.On reload, we get back whichever UUID was last committed but since the save was still running, if we reload mid-save the server may have just deleted the previous row and not yet inserted the new one, resulting in only 2 slides coming back instead of 3.
Before
Screen.Recording.2026-04-13.at.5.22.10.AM.mov
After
Screen.Recording.2026-04-13.at.5.22.56.AM.mov