Commit 0d87a06
committed
Fix overlapping note_detail() calls orphaning editor instances
Clicking a note re-entered note_detail() while a previous call was
still mid-flight, so two overlapping calls both passed the teardown
check before either nulled note_split, both created a fresh
SplitEditor, and whichever resolved last silently overwrote
note_split -- orphaning the loser's instance (websocket, DOM nodes)
with no destroy() ever called. Add a per-call token checked after
every await so a superseded call detects it lost the race and tears
down what it already created. Also defensively remove any stray
collab bar/badge left behind by an orphaned instance on create().1 parent a6a89f2 commit 0d87a06
2 files changed
Lines changed: 46 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
611 | 612 | | |
612 | 613 | | |
613 | 614 | | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
614 | 627 | | |
615 | 628 | | |
616 | 629 | | |
617 | 630 | | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
618 | 635 | | |
619 | 636 | | |
620 | 637 | | |
| |||
629 | 646 | | |
630 | 647 | | |
631 | 648 | | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
632 | 654 | | |
633 | 655 | | |
634 | 656 | | |
635 | 657 | | |
636 | 658 | | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
637 | 663 | | |
638 | 664 | | |
639 | 665 | | |
| |||
642 | 668 | | |
643 | 669 | | |
644 | 670 | | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
645 | 674 | | |
646 | 675 | | |
647 | 676 | | |
| |||
667 | 696 | | |
668 | 697 | | |
669 | 698 | | |
| 699 | + | |
670 | 700 | | |
671 | | - | |
| 701 | + | |
672 | 702 | | |
673 | 703 | | |
674 | | - | |
| 704 | + | |
675 | 705 | | |
676 | 706 | | |
677 | | - | |
678 | | - | |
679 | | - | |
| 707 | + | |
| 708 | + | |
680 | 709 | | |
681 | 710 | | |
| 711 | + | |
682 | 712 | | |
683 | 713 | | |
684 | 714 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
359 | 359 | | |
360 | 360 | | |
361 | 361 | | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
362 | 367 | | |
363 | 368 | | |
364 | 369 | | |
| |||
400 | 405 | | |
401 | 406 | | |
402 | 407 | | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
403 | 414 | | |
404 | 415 | | |
405 | 416 | | |
| |||
0 commit comments