← Back to Pull requests

[ZEPPELIN-6661] Cover notebook editor save timing #5483

Closed
unknown closed this pull request without merging on Sep 26, 2026 05:55 UTC
View on GitHub
unknown unknown commented on Sep 14, 2026 14:51 UTC
Author

What is this PR for?


When a paragraph save response arrives late, ParagraphBase treats it as a remote update and replaces the editor text, losing edits typed in the meantime.

This PR tracks pending saves by msgId. A response to one of the user's own saves no longer replaces the editor text when a newer edit or save followed it; otherwise the response is the server copy and is applied as before. Other paragraph fields in that response always apply.

Related behavior changes in ParagraphBase:
A remote edit that differs from the local unsaved text now replaces it and resets the saved baseline, so the discarded local text is not re-committed later.
An empty local edit (all text deleted) is now treated as a local edit and protected like any other.
A broadcast that does not match a pending local save and repeats the saved text no longer rewinds the editor while the user is typing.

This PR adds the E2E scenarios for ZEPPELIN-6661 (idle autosave, edit during an in-flight save). The in-flight scenario fails without this fix, so the fix is included here.

ParagraphBase reads the save acknowledgement msgId from the message envelope (@MessageEnvelopeListener(OP.PARAGRAPH)). The SDK commitParagraph(), insertParagraph() and copyParagraph() now return the sent msgId, and MessageService records the insert/copy msgId used for editor focus from that return value instead of subscribing to sent().

What type of PR is it?


Bug Fix

Todos


[x] Match save responses to pending saves by msgId
[x] Add unit tests and browser scenarios for save timing
[x] Register the scenarios in the notebook parity inventory

What is the Jira issue?


ZEPPELIN-6661

How should this be tested?


cd zeppelin-web-angular
npx vitest run --config vitest.shell.config.mts src/app/core/paragraph-base/paragraph-base.spec.ts projects/zeppelin-sdk/src/message.spec.ts src/app/services/message.service.spec.ts
npm run check:notebook-parity-scenarios
CI=true PLAYWRIGHT_HTML_OPEN=never npm run e2e -- --reporter=list tests/notebook/persistence/notebook-save-timing.spec.ts

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: 288 lines (+216 / -72) across 3 files Reviewer: tbonelee Review duration: 16743m
    All Vouch review confidence checks passed
    Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 288 lines diff across 3 files
    0.40
    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.339
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #5483"
    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: 39.8% (MEDIUM) · Higher = larger blast radius
    39.8%
    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: 15.7% · Safe to merge
    15.7%