You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f66524f
Browse filesBrowse the repository at this point in the historyBrowse files
authored
fix(joint-router-avoid): cancel a queued one-shot pass superseded by start() (#3490)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Arthur Khakhlou <arthur.khokhlov@gmail.com>
RouterService - a `routeAll()`/`routeSubgraph()` pass still queued when `start()` is called now resolves as `cancelled` instead of running after `start()`'s full sync and resetting the engine to the pass's subset under the live graph listener - a crash path, since the listener referencing an element the engine no longer held aborted the WASM module irrecoverably
Copy file name to clipboardExpand all lines: packages/joint-router-avoid/src/RouterService.mts
+13-2Lines changed: 13 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -335,6 +335,7 @@ export class RouterService {
335
335
* normal teardown does not surface as an unhandled promise rejection.
336
336
* Unexpected errors are re-thrown and stay unhandled - there is no
337
337
* caller to propagate them to.
338
+
*
338
339
*/
339
340
privatebackgroundSync(): void{
340
341
this.sync(this.graph.getCells()).catch((error)=>{
@@ -373,7 +374,7 @@ export class RouterService {
373
374
* graph's current cells. Unlike {@link start}, this attaches no graph
374
375
* listener - nothing keeps the graph routed as it changes afterwards.
375
376
*
376
-
* @returns The {@link RoutingResult} of the pass.
377
+
* @returns The {@link RoutingResult} of the pass - `{ status: 'cancelled' }` if {@link start} or {@link destroy} is called before the queued pass runs.
377
378
* @throws If the router is currently started (see {@link isStarted}) - call {@link stop} first.
378
379
*/
379
380
routeAll(): Promise<RoutingResult>{
@@ -395,7 +396,7 @@ export class RouterService {
395
396
* graph listener.
396
397
*
397
398
* @param cells - The cells to route; only the elements and links in this array are considered.
398
-
* @returns The {@link RoutingResult} of the pass.
399
+
* @returns The {@link RoutingResult} of the pass - `{ status: 'cancelled' }` if {@link start} or {@link destroy} is called before the queued pass runs.
399
400
* @throws If the router is currently started (see {@link isStarted}) - call {@link stop} first.
0 commit comments