You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@zeppelin.apache.org by "xhaktm00 (via GitHub)" <gi...@apache.org> on 2026/09/09 06:53:16 UTC
[PR] [ZEPPELIN-6697] Prevent live NOTE_UPDATED from mutating revision snapshots [zeppelin]
xhaktm00 opened a new pull request, #5468:
URL: https://github.com/apache/zeppelin/pull/5468
### What is this PR for?
`NotebookServer.updateNote()` broadcasts `NOTE_UPDATED` to every socket associated with the note, and a socket that navigates to a saved revision keeps that association. The Angular handler applied the payload unconditionally:
```typescript
@MessageListener(OP.NOTE_UPDATED)
noteUpdated(data) {
if (!this.note) {
return;
}
this.note.config = data.config; // overwrites the historical snapshot
```
So changing the live note's look and feel from another browser rewrote the snapshot the revision view was showing.
The guard already exists elsewhere in the same component — `removeParagraph`, `addParagraph` and `moveParagraph` all check `revisionView`, and ZEPPELIN-2452 added the same check to the classic UI. It was only partly carried over during the migration, and `noteUpdated` was the one left out. This adds it there.
Per the issue, this stays out of `noteId`, request correlation and socket generation: the reproduction only proves a revision-isolation defect, and nothing here required a wire change. The Shared Notebook Core revision adapter is not covered yet, since that slice has not landed.
### What type of PR is it?
Bug Fix
### Todos
* [x] Guard `noteUpdated` with `revisionView`
* [x] Add a retained Playwright regression for the same-tab live-to-revision route
### What is the Jira issue?
* [ZEPPELIN-6697](https://issues.apache.org/jira/browse/ZEPPELIN-6697)
### How should this be tested?
New spec `e2e/tests/notebook/revision/revision-isolation.spec.ts` opens a note, saves a revision, enters it on the same socket, then changes look and feel from an independent browser context. It asserts the live follower applies the update, and that the revision view still shows the value it was saved with.
```
cd zeppelin-web-angular && npx playwright test e2e/tests/notebook/revision/revision-isolation.spec.ts --project=chromium
```
Result: `2 passed (21.8s)`.
Reverting only the guard makes it fail, so it does catch the defect rather than passing by construction:
```
Error: expect(locator).toContainText(expected) failed
Expected string: "default"
Received string: " simple "
```
Two details the spec depends on, both found the hard way:
- **Look and feel, not rename.** Renaming goes through `renameNote`, which answers with `broadcastNote()` (`OP.NOTE`) and never emits `NOTE_UPDATED`. `setLookAndFeel()` is what calls `updateNote()`, which is why the issue names it in the reproduction.
- **Waiting for the event.** Asserting the snapshot straight after the live change passes trivially, because the assertion resolves before the broadcast arrives. The spec first polls the revision page's console for `Receive: NOTE_UPDATED`, then asserts.
### Screenshots (if appropriate)
N/A
### Questions:
* Does the license files need to update? No
* Is there breaking changes for older versions? No — a live follower still applies the same update exactly once; only a revision view ignores it
* Does this needs documentation? No
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@zeppelin.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [ZEPPELIN-6697] Prevent live NOTE_UPDATED from mutating revision snapshots [zeppelin]
Posted by "voidmatcha (via GitHub)" <gi...@apache.org>.
voidmatcha commented on PR #5468:
URL: https://github.com/apache/zeppelin/pull/5468#issuecomment-5646406999
Merged into master (5e36932e).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@zeppelin.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [ZEPPELIN-6697] Prevent live NOTE_UPDATED from mutating revision snapshots [zeppelin]
Posted by "voidmatcha (via GitHub)" <gi...@apache.org>.
voidmatcha merged PR #5468:
URL: https://github.com/apache/zeppelin/pull/5468
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@zeppelin.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org