Commit d2d2156
committed
fix(emcn): sweep route-scoped toasts during render, not after child effects
The provider cleared route-scoped toasts from a pathname effect. Effects run
child-first, so it also swept toasts the newly rendered route had just raised:
any toast added from a child's mount effect — which is what happens whenever
that child's data is already cached — was appended and filtered out in the same
commit, before it painted.
Move the sweep into render, where it runs before children render, so only
toasts predating the navigation are cleared. Timers and heights were already
reconciled by effects keyed off `toasts`, so this stays a pure state update.
Drops the persistAcrossRoutes workaround the table lock notice needed to dodge
the bug; its tableId-keyed cleanup stays, covering embedded swaps that change
the prop without a route change.1 parent 072f658 commit d2d2156
2 files changed
Lines changed: 26 additions & 35 deletions
Lines changed: 3 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
627 | 627 | | |
628 | 628 | | |
629 | 629 | | |
630 | | - | |
631 | | - | |
632 | | - | |
633 | | - | |
634 | | - | |
635 | 630 | | |
636 | 631 | | |
637 | 632 | | |
| |||
656 | 651 | | |
657 | 652 | | |
658 | 653 | | |
659 | | - | |
660 | | - | |
661 | | - | |
662 | | - | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
663 | 657 | | |
664 | 658 | | |
665 | 659 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
396 | 396 | | |
397 | 397 | | |
398 | 398 | | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
399 | 422 | | |
400 | 423 | | |
401 | 424 | | |
| |||
459 | 482 | | |
460 | 483 | | |
461 | 484 | | |
462 | | - | |
463 | | - | |
464 | | - | |
465 | | - | |
466 | | - | |
467 | | - | |
468 | | - | |
469 | | - | |
470 | | - | |
471 | | - | |
472 | | - | |
473 | | - | |
474 | | - | |
475 | | - | |
476 | | - | |
477 | | - | |
478 | | - | |
479 | | - | |
480 | | - | |
481 | | - | |
482 | | - | |
483 | 485 | | |
484 | 486 | | |
485 | 487 | | |
| |||
536 | 538 | | |
537 | 539 | | |
538 | 540 | | |
539 | | - | |
540 | | - | |
541 | | - | |
542 | | - | |
543 | | - | |
544 | 541 | | |
545 | 542 | | |
546 | 543 | | |
| |||
0 commit comments