kevinjmh opened a new pull request, #5254:
URL: https://github.com/apache/zeppelin/pull/5254
### What is this PR for?
**Problem**
When cloning a paragraph in zeppelin-web-angular, the cloned paragraph only
contains the interpreter binding (e.g., %mysql) but not the actual editor
content (e.g., select 1 a, 2 a). The old zeppelin-web handles this correctly.
**Root Cause Analysis**
The backend copyParagraph is a two-step operation:
```
1. insertParagraph() → broadcasts PARAGRAPH_ADDED (empty new paragraph,
text="%mysql\n")
2. updateParagraph() → broadcasts PARAGRAPH (full
text="%mysql\nselect 1 a, 2 a")
```
Step 2's PARAGRAPH response gets silently discarded by the frontend
shortCircuit mechanism in message.ts. The original filter logic compares the
currently-sent message sequence number against the received response's sequence
number:
```ts
// OLD logic — overly aggressive
if (this.lastMsgIdSeqSent > msgIdSeqReceived) {
// "message is already updated by shortcircuit" → discard!
return false;
}
```
The problem: between sending COPY_PARAGRAPH (seq=49) and receiving its
PARAGRAPH response, other unrelated messages like EDITOR_SETTING (seq=50) may
be sent. This makes lastMsgIdSeqSent (50) > msgIdSeqReceived (49), causing the
legitimate PARAGRAPH response for the cloned paragraph to be incorrectly
filtered out.
<img width="807" height="951" alt="image"
src="https://github.com/user-attachments/assets/3395e3eb-352c-45f7-96ca-68d3d3f5a983"
/>
**Solution**
Replace the implicit sequence-number comparison with an explicit tracking
set (shortCircuitedParagraphMsgIds). Only messages that were explicitly passed
to shortCircuit() get filtered — not all messages where lastMsgIdSeqSent >
receivedSeq.
### What type of PR is it?
Bug Fix
### Todos
* [ ] - Task
### What is the Jira issue?
* Open an issue on Jira https://issues.apache.org/jira/browse/ZEPPELIN/
* Put link here, and add [ZEPPELIN-*Jira number*] in PR title, eg.
[ZEPPELIN-533]
### How should this be tested?
* Strongly recommended: add automated unit tests for any new or changed
behavior
* Outline any manual steps to test the PR here.
### Screenshots (if appropriate)
### Questions:
* Does the license files need to update?
* Is there breaking changes for older versions?
* Does this needs documentation?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]