Conversation
NoteNode.loadAndProcessNote took the leaf name from the JSON name field, so a renamed note whose JSON was not rewritten reloaded under its old name. Take the leaf from the tree as well and remove the rename re-save in moveNote, along with its extra disk write and lock nesting.
This branch has not been deployed
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.
What is this PR for?
NoteManager.NoteNode.loadAndProcessNoterebuilt a reloaded note's path from the tree for the folder but from the JSONnamefield for the leaf. A renamed note whose JSON had not been rewritten came back under its old name, which is the only reasonmoveNotere-saved after a rename (and the source of the ZEPPELIN-5858 race).This PR takes the leaf from the tree as well (
note.setPath(getNotePath())) and removes the rename re-save block inmoveNote, together with its disk write and lock nesting.Trade-off: after a rename, the
namefield in the on-disk JSON stays behind until the note is next saved. Zeppelin does not read it for location, andexportNoteserializes the in-memory note, so exports are unaffected.What type of PR is it?
Improvement
Todos
What is the Jira issue?
ZEPPELIN-6595
How should this be tested?
NoteManagerTest#testReloadAfterRenameDerivesLeafNameFromTree: uses a JSON round-trip repo (like S3/GCS/FileSystem) so a stalenameactually surfaces on reload.NoteManagerMoveResaveRaceTest#testRenameDoesNotReloadOrResave: repurposed from the ZEPPELIN-5858 test; assertsmoveNoteno longer reloads from the repo and still leaves exactly one.zplnfile.NotebookTest#testMoveNote: now asserts the file location and the reloaded path/name instead of the JSONnamecontent.Questions: