fix(joint-router-avoid): fire idle after incremental main-thread changes - #3489
Open
kumilingus wants to merge 1 commit into
Open
fix(joint-router-avoid): fire idle after incremental main-thread changes#3489kumilingus wants to merge 1 commit into
kumilingus wants to merge 1 commit into
Conversation
MainThreadProvider only triggered 'processed' inside sync(), so the RouterService 'idle' event fired after the initial sync / routeAll() and never again after ordinary graph changes with worker: false. The incremental paths (setShape/setConnector/deleteShape/deleteConnector) now run through a shared processTransaction() helper that announces the pass, matching the Worker provider's behaviour. setConnector's loose-end deletion forwards the 'process' flag, so a batched sync() no longer processes (and announces) a transaction mid-batch. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Geliogabalus
approved these changes
Aug 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
RouterServiceemitsidlewhen its provider triggersprocessed— butMainThreadProvideronly triggeredprocessedinsidesync(). Withworker: false,idletherefore fired after the initial sync /routeAll()and never again after ordinary graph changes (element moves, link edits).WorkerProviderpostsprocessedafter every debounce batch, so worker mode behaves as documented; the main-thread incremental paths now match it.Changes
setShape/setConnector/deleteShape/deleteConnector) run through a sharedprocessTransaction()helper that runs the pass and triggersprocessed.setConnector's loose-end deletion forwards theprocessflag — previously a batchedsync()could run (and announce) a transaction mid-batch through that branch.Tests
TDD — both written first and watched fail:
an element move fires idle,a link removal fires idle(main-thread provider, synchronous assertion). 30/30 passing; lint clean. Changeset:@joint/router-avoidpatch.Split out of #3488 (the
worker.createWorkerfeature, againstdev) — same source markdown issue, independent defect.🤖 Generated with Claude Code