← Back to Pull requests

[ZEPPELIN-6718] Carry every persisted field into a personalized user note #5494

Closed
unknown closed this pull request without merging on Sep 21, 2026 14:28 UTC
View on GitHub
unknown unknown commented on Sep 20, 2026 13:55 UTC
Author

What is this PR for?

Reading a personalized note does not return the note itself. NotebookService.getNote hands back a per-user copy built by Note.getUserNote(user), and that copy is assembled by moving fields across one at a time, covering 5 of the 11 persisted fields.

path, defaultInterpreterGroup, version, info, noteParams and noteForms are left null. Gson omits null fields, so those keys disappear from every response for a personalized note, over REST and WebSocket alike.

path is the one that breaks the UI. It is not stored in the note file: the path comes from where the file sits and is reattached by NoteManager after load, so a copy that loses it has nowhere to recover it from. The front end reads it to detect the trash folder, note.path.split('/') throws on undefined, and the exception aborts change detection so the notebook action bar is never rendered. That includes the button that turns personalized mode back off, which means a note switched to personalized mode cannot be switched back from the UI.

The server defect has been there since getUserNote was introduced in ZEPPELIN-1594. The classic UI guarded against the missing value:

// zeppelin-web/src/app/notebook/notebook.controller.js:267
return note && note.path ? note.path.split('/')[1] === TRASH_FOLDER_ID : false;

The Angular UI carries the same check without that guard, which is what finally exposed the server side.

This PR copies the six missing fields. Because the copy is still written field by field, it also adds a regression test that walks every persisted field of Note by reflection and compares the copy against the original, so a field added to Note later and not copied here fails by name.

The front end is left alone on purpose. path is a value the server must always send; typing it as optional or guarding at the call site would let the same class of server defect pass unnoticed again, which is exactly why this one went unnoticed for so long.

What type of PR is it?


Bug Fix

Todos


[x] Copy the six fields getUserNote was dropping
[x] Add a reflection regression test that catches a future missing field

What is the Jira issue?


ZEPPELIN-6718

How should this be tested?

./mvnw test -pl zeppelin-server --am -Dtest=NoteTest

10 tests pass. Reverting the change to Note.java while keeping the tests makes the two new ones fail and name the cause:

[ERROR] Tests run: 10, Failures: 2, Errors: 0, Skipped: 0
[ERROR]   NoteTest.userNoteKeepsEveryPersistedField:254 getUserNote dropped Note.defaultInterpreterGroup ==> expected: <spark> but was: <null>
[ERROR]   NoteTest.userNoteKeepsThePath:233 expected: </folder/my note> but was: <null>

Checked by hand as well. Create a note, switch it to personal mode, and open it. Before the change, GET /api/notebook/{noteId} comes back without path and the console repeats the split error while the action bar never renders. After it, path is back, no errors are logged, the action bar renders, and Switch to collaboration mode completes the switch (personalizedMode: false).

Screenshots (if appropriate)


N/A

Questions:


Does the license files need to update? No
Is there breaking changes for older versions? No
Does this needs documentation? No

Diff: 421 lines (+315 / -106) across 5 files Reviewer: ParkGyeongTae Review duration: 1472m
All Vouch review confidence checks passed
Residual risk 0.18 = Change Risk (0.45) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.45 · 421 lines diff across 5 files
0.45
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.362
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #5494"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 45% (MEDIUM) · Higher = larger blast radius
45%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 17.8% · Safe to merge
17.8%