[ZEPPELIN-6556] Personalized mode leaks a non-owner's paragraph edits into the shared master paragraph - #5360
Open
xhaktm00 wants to merge 2 commits into
Open
[ZEPPELIN-6556] Personalized mode leaks a non-owner's paragraph edits into the shared master paragraph#5360xhaktm00 wants to merge 2 commits into
xhaktm00 wants to merge 2 commits into
Conversation
xhaktm00
force-pushed
the
ZEPPELIN-6556
branch
2 times, most recently
from
August 2, 2026 05:17
42c570e to
2cc99e3
Compare
… into the shared master paragraph
…personalized mode PersonalizeActionsIT.testGraphAction showed that blocking every master-paragraph write in personalized mode also blocked the note owner's changes, so new users no longer inherited them. Guard the master write with an owner check instead: the owner's changes update both the master and their personal copy (previous behavior), while a non-owner's changes stay in their personal copy only.
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?
A note can be switched to personalized mode so that each user gets their own copy of a paragraph and one user's form values and results do not affect another's.
However,
NotebookService.runParagraphwrites the caller'sparams,text,titleandconfiginto the shared master paragraph before it checks whether the note is personalized:notebook.saveNote(...)then persists the polluted master. The same ordering exists inupdateParagraph, andsetParagraphUsingMessageis worse: its personalized branch re-fetches the master vianote.getParagraph(paragraphId)instead of resolving the user copy, so it writes the same values into the master twice and never touches the user copy at all.So in personalized mode, a non-owner who edits a dynamic form and runs the paragraph silently overwrites the shared original.
Because
Paragraph.userParagraphMapis transient, the per-user copies do not survive a restart. The corruption stays invisible while the copies exist and surfaces later:Note.clearUserParagraphs) exposes the polluted masterThe fix: resolve the target paragraph first — when the note is personalized, switch to
getUserParagraph(user)before any write — so the master paragraph is never mutated by another user's run or update. Applied torunParagraph,updateParagraphandsetParagraphUsingMessage. Since the two branches wrote identical values, this also removes the duplicated write blocks.The only caller of
setParagraphUsingMessageisspell(), which now records the spell result on the user copy in personalized mode — the intended behavior — instead of on the shared master.Note:
PersonalizeActionsIT.testDynamicFormActionasserts the correct behavior (a non-owner's edit must not leak) but was passing against the old server behavior only because a late WebSocket broadcast reverted the typed form value before the run.What type of PR is it?
Bug Fix
Todos
runParagraph,updateParagraphandsetParagraphUsingMessagesetParagraphUsingMessagere-fetching the master in its personalized branchWhat is the Jira issue?
How should this be tested?
New test
NotebookServiceTest#testRunParagraphInPersonalizedModeDoesNotPolluteMasterParagraph: on a personalized note, it runs and then updates a paragraph asuser1with new params/title, and asserts that the master paragraph's params and title are unchanged whilegetUserParagraph("user1")picks up the new values.Result with the fix:
Tests run: 6, Failures: 0, Errors: 0.Manual verification: create a note with
%sh echo "hello, ${name=original}", run it, enable personalized mode, log in as a second user, change the form value and run. Then turn personalized mode off (or restart the server): the paragraph must still showoriginal.Screenshots (if appropriate)
N/A
Questions: