Skip to content

fix(sync): handle missing position events without breaking sync stream#6489

Open
VuMartin wants to merge 3 commits into
apache:mainfrom
VuMartin:fix/6420-position-sync-error-handling
Open

fix(sync): handle missing position events without breaking sync stream#6489
VuMartin wants to merge 3 commits into
apache:mainfrom
VuMartin:fix/6420-position-sync-error-handling

Conversation

@VuMartin

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

This PR fixes an issue where a missing position entry could break the position synchronization stream during collaborative editing.

Instead of allowing an undefined old position to propagate, the position change event is filtered out so the stream continues processing future valid events.

Before (simulated missing position scenario):
If a position change event was received for an operator whose position was missing from elementPositions, the stream could error out and stop processing future position updates, breaking synchronization.

image

After:
Position change events with missing position information are ignored, allowing the stream to continue processing subsequent valid position updates and preserving synchronization.

Screenshot 2026-07-17 at 1 23 31 AM

Any related issues, documentation, discussions?

Closes #6420

How was this PR tested?

Manual test:

  • Opened two browser tabs with two different users
  • Simulated the missing-position scenario by removing the position entry
  • Verified that position sync continued after the bad event
  • Confirmed add/delete operations still worked independently

Added a unit test that simulates a missing position entry by removing an operator's position from the internal position map before triggering a position change. The test verifies that the invalid event is ignored and that subsequent valid position change events are still emitted correctly.

Ran:

yarn test --include=src/app/workspace/service/workflow-graph/model/joint-graph-wrapper.spec.ts

Was this PR authored or co-authored using generative AI tooling?

Generated-by: ChatGPT (GPT-5.5 mini)

@github-actions github-actions Bot added fix frontend Changes related to the frontend GUI labels Jul 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @bobbai00
    You can notify them by mentioning @bobbai00 in a comment.

@codecov-commenter

codecov-commenter commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.31%. Comparing base (e793be5) to head (963d9dd).
⚠️ Report is 28 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #6489      +/-   ##
============================================
+ Coverage     69.83%   70.31%   +0.47%     
  Complexity     3383     3383              
============================================
  Files          1142     1142              
  Lines         44844    44872      +28     
  Branches       4949     4955       +6     
============================================
+ Hits          31318    31550     +232     
+ Misses        11874    11682     -192     
+ Partials       1652     1640      -12     
Flag Coverage Δ *Carryforward flag
access-control-service 70.00% <ø> (ø) Carriedforward from c0286ff
agent-service 76.76% <ø> (ø) Carriedforward from c0286ff
amber 66.67% <ø> (ø) Carriedforward from c0286ff
computing-unit-managing-service 9.97% <ø> (ø) Carriedforward from c0286ff
config-service 52.30% <ø> (ø) Carriedforward from c0286ff
file-service 63.97% <ø> (ø) Carriedforward from c0286ff
frontend 69.27% <100.00%> (+1.10%) ⬆️
notebook-migration-service 78.94% <ø> (ø) Carriedforward from c0286ff
pyamber 91.19% <ø> (ø) Carriedforward from c0286ff
workflow-compiling-service 55.14% <ø> (ø) Carriedforward from c0286ff

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix frontend Changes related to the frontend GUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Operator position sync silently stops for a tab: a single error in getElementPositionChangeEvent() permanently kills the drag-broadcast stream

2 participants