Skip to content

Backport #18704 to core/1.55 - #19182

Closed
christian-byrne wants to merge 1 commit into
core/1.55from
christian-byrne/backport-18704-core-1.55
Closed

christian-byrne wants to merge 1 commit into
core/1.55from
christian-byrne/backport-18704-core-1.55

Conversation

@christian-byrne

Copy link
Copy Markdown
Contributor

Backports #18704 (stops retrying permanently refused CRDT document subscriptions) to core/1.55.

The automated cherry-pick conflicted where 1.55 lacks the newer undo-bracket API. This keeps the release branch reset path and adds the refusal-state reset directly, while preserving the permanent-error notification and retry gate.

Validation:

  • 4 focused suites: 381 tests passed
  • full workspace typecheck passed
  • changed-file formatting passed
  • pre-push Knip/Fallow gate passed

@coderabbitai

coderabbitai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository: Comfy-Org/ComfyUI_frontend/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Team

Run ID: cba65ee9-8125-4151-b462-50224dbab22c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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

@christian-byrne

Copy link
Copy Markdown
Contributor Author

Self-review complete. The 1.55 conflict resolution deliberately preserves the release reset flow and adds only there; it does not import the newer undo-bracket dependency. The permanent refusal gate, durable error toast, and reset coverage remain intact. Local evidence: 381 focused tests, full workspace typecheck, formatting, and dependency checks passed.

@christian-byrne

Copy link
Copy Markdown
Contributor Author

Correction: the release reset flow adds only resetNotifiedGiveUp(); it intentionally does not import the newer undo-bracket dependency.

@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

🌾 Fallow: ✅ Passed

Fallow audits the diff for duplication, complexity and dead code. It gates on new findings only, so when the audit completes, a red is something this PR introduced or moved — never inherited backlog. A red can also mean the audit itself did not finish; the details below say which happened.

No new findings in the changed files.

Reproduce locally
# the base the gate compared against
npx fallow audit --root . --quiet --format json \
  --changed-since cc9fbc154c5612bfb341682efeb4340e45641024

Full docs: ADR-DEVEX-LINT-0015

🎨 Storybook: ✅ Built — View Storybook

Details

⏰ Completed at: 09/28/2026, 04:02:27 AM UTC

Links

🧩 Custom Nodes Ecosystem Matrix: ✅ Passed

Executes the frontend JS of every registry pack that ships any, against this change, in both renderers. The eight ecosystem-matrix shard checks are a harness self-test; the pack verdict is matrix-verdict.

Stage Result What a failure here means
pin-status success Informational. It never fails the build; it warns when the corpus snapshot is over 30 days old.
corpus success Infrastructure: the pack mirror could not be fetched, validated or cached. Not your diff.
shards success Harness integrity, not pack breakage. A shard only checks that every built spec wrote its row; vitest's own exit code is deliberately ignored because pack code leaks unhandled rejections.
verdicts success The population verdict per renderer. This is the stage that judges packs. Exit 1 is FAIL; exit 2 is withheld — rows were missing, so nothing was measured, which is not the same as your change breaking packs.
detection-proofs success The instrument self-test: the matrix must FAIL on a deliberately poisoned corpus. A failure here means the gate cannot be trusted this run, in either direction.

On a pin-bump PR, a red gate means the ecosystem moved — not that your diff broke something. That is what the bump PR is for. Outside a pin bump or a cold rebuild of the unpinned tail, a red means the diff.

Note the corpus size and the executed count are different numbers, and the verdict is against the executed count: roughly 3,100 of ~5,100 packs ship no extension-shaped JS and are skipped.

Reproduce locally
# build one shard's fixture, then run it
python3 scripts/registry-census/build_matrix.py --shard 1/4
MATRIX_RENDERER=vue MATRIX_VUE=1 \
  npx vitest run --config vitest.matrix.config.mts

Full docs: scripts/registry-census/README.md

🎭 Playwright: ✅ 2119 passed, 0 failed · 3 flaky

📊 Browser Reports
  • chromium: View Report (✅ 2098 / ❌ 0 / ⚠️ 3 / ⏭️ 13)
  • chromium-2x: View Report (✅ 2 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • chromium-0.5x: View Report (✅ 1 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • mobile-chrome: View Report (✅ 18 / ❌ 0 / ⚠️ 0 / ⏭️ 0)

@christian-byrne
christian-byrne force-pushed the christian-byrne/backport-18704-core-1.55 branch from e2b7681 to 81fb929 Compare September 28, 2026 03:50
Backport #18704 to the 1.55 release branch with its native reset path. Preserve the permanent schema-mismatch refusal gate, durable sync-error notification, and reset of the one-shot give-up latch.
@christian-byrne
christian-byrne force-pushed the christian-byrne/backport-18704-core-1.55 branch from 81fb929 to 501edcf Compare September 28, 2026 03:50
@christian-byrne
christian-byrne enabled auto-merge (squash) September 28, 2026 03:51
@github-actions github-actions Bot added the risk:high PR risk grade (advisory shadow check; grader-owned) label Sep 28, 2026
@christian-byrne

Copy link
Copy Markdown
Contributor Author

Closing as duplicate: the intended backport already merged in #19165.

auto-merge was automatically disabled September 28, 2026 04:11

Pull request was closed

@christian-byrne
christian-byrne deleted the christian-byrne/backport-18704-core-1.55 branch September 28, 2026 04:11
@codecov

codecov Bot commented Sep 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@             Coverage Diff             @@
##           core/1.55   #19182    +/-   ##
===========================================
  Coverage      84.65%   84.66%            
===========================================
  Files           2302     2303     +1     
  Lines         131881   132020   +139     
  Branches       35615    35651    +36     
===========================================
+ Hits          111649   111772   +123     
- Misses         19913    19929    +16     
  Partials         319      319            
Flag Coverage Δ
unit 80.59% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/workbench/extensions/agent/AgentPanelRoot.vue 90.26% <100.00%> (+0.01%) ⬆️
...nch/extensions/agent/crdt/agentCrdtDocLifecycle.ts 99.46% <100.00%> (+0.11%) ⬆️
src/workbench/extensions/agent/crdt/devPanelLog.ts 86.86% <ø> (ø)
...ench/extensions/agent/crdt/useAgentCrdtFollower.ts 97.87% <100.00%> (+0.05%) ⬆️
...h/extensions/agent/crdt/workflowSyncErrorDetail.ts 100.00% <100.00%> (ø)

... and 9 files with indirect coverage changes

🚀 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.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Cursor Review — Consolidated panel

Triggered by @christian-byrne.

Found 9 finding(s).

Severity Count
🟠 High 2
🟡 Medium 3
🟢 Low 3
⚪ Nit 1

Panel: 8/8 reviewers contributed findings.

// FE #16637 residual: a refusal is the earliest signal the sender can
// get that its in-flight batch's doc is gone — don't make it wait out
// the 10 s result-silence window to notice on its own.
releaseHeldOps()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 High — Even when handleSubscribeRefusal classifies the frame as a stale straggler (shouldNotify: false), connected.value was already set to false above and releaseHeldOps() + sender.abortIfUnbound() still run unconditionally — so in the exact race confirmedSinceLastSend was added to defend, the healthy confirmed channel is still reported disconnected and the user's in-flight human-op batch is settled as unbound/unconfirmed. Gate the teardown (and the connected.value = ok assignment) on the refusal being fresh, or correlate acknowledgements by attempt/generation before mutating any bridge state. Raised by 5 of 8 reviewers (gemini-3.1-pro adversarial, gpt-5.6-sol-max adversarial, kimi-k3-max adversarial, kimi-k3-max edge-case, claude-opus-5-thinking-max edge-case).

// See `confirmedSinceLastSend`: bail out before touching any timer,
// so a stale straggler can't clear the probe/backoff state the
// confirm it raced behind already armed.
if (this.confirmedSinceLastSend) return false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 High — The confirmedSinceLastSend bail-out sits inside the permanent-code branch, so a stale retryable refusal (e.g. a delayed doc_not_found answering attempt 1) landing after attempt 2 confirmed still runs clearStaleProbe() and scheduleSubscribeRetry(), cancelling the probe the confirm just armed and forcing a resubscribe on a healthy channel. The guard's own premise — a confirm and a refusal can never answer the same subscribe — is code-independent, so hoist the check above the branch. Raised by 4 of 8 reviewers (gemini-3.1-pro adversarial, gemini-3.1-pro edge-case, claude-opus-5-thinking-max adversarial, kimi-k3-max edge-case).

// A redelivered/duplicate refusal frame answers nothing new once the
// latch is already set — without this guard it would re-run the report
// and the caller's `onGaveUp` (toast/telemetry) a second time.
if (this.gaveUp) return false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium — giveUp() (ack-timeout exhaustion) also sets gaveUp = true, so when a host slow enough to blow the ack budget finally answers with a permanent code, giveUpPermanently returns at this guard: no toast, no reportError naming the real cause, and no subscribe_refused_permanent dev event — telemetry reads "never acknowledged" instead of schema_version_mismatch. That is precisely the case where the explanation matters most; key the duplicate guard on a distinct permanent latch rather than the shared gaveUp flag. Raised by 3 of 8 reviewers (claude-opus-5-thinking-max adversarial, claude-opus-5-thinking-max edge-case, kimi-k3-max adversarial).

// A reconnect that lands the same permanent code for the same workflow
// is one unchanged fact - only a different workflow (retarget/doc_reset,
// see `resetNotifiedGiveUp`) is a new one worth telling the person about.
if (workflowId !== null && workflowId === this.lastNotifiedGiveUpWorkflowId)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium — The comment says a reconnect landing "the same permanent code for the same workflow" is one unchanged fact, but only the workflow id is recorded and compared — code never is. A reconnect returning a different permanent reason for the same workflow (e.g. catalog_mismatch after schema_version_mismatch) is therefore suppressed, leaving the user with the wrong explanation — the very distinction the new code plumbing and workflowSyncFailedDetailCatalogMismatch copy exist to draw — and dropping the distinct cause from telemetry. Key the marker on (workflowId, code). Raised by 4 of 8 reviewers (gpt-5.6-sol-max adversarial, claude-opus-5-thinking-max adversarial, claude-opus-5-thinking-max edge-case, kimi-k3-max edge-case).

this.gaveUp = false
this.usedCatchUpGrace = false
this.resetForNewAttempt()
this.resetNotifiedGiveUp()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium — clearForRetarget() now re-arms notification, but the follower's watcher calls it on every [workflowId, isTargetActive] change — including a deactivate/reactivate cycle for the same workflow. Switching tabs away from and back to a permanently unsyncable workflow therefore resubscribes, is refused again, and fires another never-expiring toast, so ordinary navigation stacks identical errors. Reset the marker only when the workflow/lineage actually changes, not when activity alone toggles. Raised by 4 of 8 reviewers (claude-opus-5-thinking-max edge-case, gpt-5.6-sol-max edge-case, kimi-k3-max adversarial, claude-opus-5-thinking-max adversarial).

summary: t('agent.workflowSyncFailedTitle'),
detail: formatWorkflowSyncErrorDetail(t, message, code),
// A permanent desync remains visible until the person dismisses it.
life: 0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Low — Nothing ever removes this life: 0 toast and the toast store has no dedup or cap, while the permanent latch is explicitly recoverable (onReconnected() clears gaveUp, onSubscribeConfirmed() resets the marker) and onDocReset re-arms notification on every doc_reset. A stale "This workflow can't sync" error can therefore sit over a canvas that is syncing normally again, and a host in a reset/refuse loop stacks sticky toasts without bound. Capture the message and toast.remove() it on the next confirm, or give it a bounded life. Raised by 3 of 8 reviewers (claude-opus-5-thinking-max edge-case, claude-opus-5-thinking-max adversarial, kimi-k3-max adversarial).

// see `resetNotifiedGiveUp`) is a new one worth telling the person about.
if (workflowId !== null && workflowId === this.lastNotifiedGiveUpWorkflowId)
return false
this.lastNotifiedGiveUpWorkflowId = workflowId

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Low — null doubles as both "nothing notified yet" (the initial value and what resetNotifiedGiveUp() writes) and the recorded marker when this.workflowId() returns null, so a refusal notified with an unknown workflow id leaves the dedup silently void — the workflowId !== null short-circuit above then re-fires reportError and a fresh sticky toast on every later refusal. Use a separate "notified" flag, or skip recording when the id is unknown. Raised by 2 of 8 reviewers (claude-opus-5-thinking-max adversarial, claude-opus-5-thinking-max edge-case).

: 'agent.workflowSyncFailedDetail'
)
if (!message) return detail
return `${detail} (${truncate(message, { length: SYNC_ERROR_RAW_MESSAGE_MAX_LENGTH })})`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Low — The doc-host's free-form message is appended verbatim into a persistent, trusted-looking toast with no sanitization beyond the 200-char clamp — newlines and control characters pass through — which discloses internal diagnostics to end users and lets a hostile or misconfigured host place attacker-chosen prose inside the app's own error UI. Consider rendering only the localized code-mapped copy and routing the raw message to reportError/dev logging. Raised by 2 of 8 reviewers (claude-opus-5-thinking-max adversarial, gpt-5.6-sol-max adversarial).

// survive the permanent latch: its callback checks only `workflowId()`,
// not `gaveUp`, so left alone it would still fire a resubscribe later.
this.clearSubscribeRetry()
if (!notify) return false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚪ Nit — This early return sits above recordDevEvent, so an unsupported refusal latches with no breadcrumb at all — not even in the debug-gated dev panel — in exactly the case that produces no other signal for why the channel stopped. Record the dev event before the notify check. Raised by 1 of 8 reviewers (claude-opus-5-thinking-max edge-case).

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

Labels

cursor-review Trigger multi-model Cursor agent review on this PR greenlight risk:high PR risk grade (advisory shadow check; grader-owned)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants