Skip to content

fix: SSE timeout and stale data causing false conflict popups in editors (#1715)#1716

Merged
yohamta0 merged 2 commits into
mainfrom
fix-sse-issue
Mar 3, 2026
Merged

fix: SSE timeout and stale data causing false conflict popups in editors (#1715)#1716
yohamta0 merged 2 commits into
mainfrom
fix-sse-issue

Conversation

@yohamta0

@yohamta0 yohamta0 commented Mar 3, 2026

Copy link
Copy Markdown
Collaborator

Fixes #1715

Summary by CodeRabbit

  • Bug Fixes
    • Fixed unexpected timeout issues in Server-Sent Events (SSE) real-time connections that could interrupt long-running operations
    • Ensured deterministic step ordering in DAG specifications to prevent non-deterministic JSON representations and inconsistent build behaviors
    • Improved editor cache synchronization in DAG and document editors by intelligently merging saved changes, preventing stale data and false conflict notifications

@coderabbitai

coderabbitai Bot commented Mar 3, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2dbf266 and 6eb7599.

📒 Files selected for processing (4)
  • internal/core/spec/dag.go
  • internal/service/frontend/sse/handler.go
  • ui/src/features/dags/components/dag-editor/DAGSpec.tsx
  • ui/src/pages/docs/components/DocEditor.tsx

📝 Walkthrough

Walkthrough

These changes address stale data conflicts during DAG and document editing by ensuring deterministic step ordering, fixing SSE stream timeouts, and implementing targeted cache synchronization between user saves and polling data.

Changes

Cohort / File(s) Summary
Backend DAG and SSE fixes
internal/core/spec/dag.go, internal/service/frontend/sse/handler.go
Sorts steps by name to ensure deterministic JSON output, eliminating non-deterministic hashing. Resets write deadline for long-lived SSE connections to prevent server timeout from terminating streams.
Frontend cache synchronization
ui/src/features/dags/components/dag-editor/DAGSpec.tsx, ui/src/pages/docs/components/DocEditor.tsx
Introduces refs to hold polling data and mutate functions across renders. On successful save, conditionally updates the SWR cache directly via mutation to merge saved data with polling data, preventing stale data conflicts and disabling automatic revalidation for precision control.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main fix: addressing SSE timeout and stale data issues causing false conflict popups in editors.
Linked Issues check ✅ Passed The code changes directly address the root causes of issue #1715: SSE stream termination, stale polling data, and deterministic ordering to prevent false conflict detection.
Out of Scope Changes check ✅ Passed All changes are focused on fixing the SSE timeout and stale data issues. No unrelated modifications to other systems or features were introduced.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-sse-issue

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@yohamta0 yohamta0 merged commit 57efc79 into main Mar 3, 2026
6 checks passed
@yohamta0 yohamta0 deleted the fix-sse-issue branch March 3, 2026 09:16
@codecov

codecov Bot commented Mar 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.44%. Comparing base (abc8974) to head (6eb7599).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1716      +/-   ##
==========================================
- Coverage   69.47%   69.44%   -0.04%     
==========================================
  Files         396      396              
  Lines       43713    43716       +3     
==========================================
- Hits        30370    30358      -12     
- Misses      10890    10900      +10     
- Partials     2453     2458       +5     
Files with missing lines Coverage Δ
internal/core/spec/dag.go 86.07% <100.00%> (+0.04%) ⬆️

... and 6 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2dbf266...6eb7599. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Dag edition is very difficult

1 participant