Commit 45a223e
fix(cookbook): review round 4 - logout releases the nonce guard
C1: the busy guard added in round 3 had no release path. Logging out while
a submission was tracking dropped the sdk-dapp session, so the terminal
callbacks could never fire and the page stayed locked forever. A regression
from the round-3 fix, not a pre-existing issue.
SendEgldLifecycle gains abandon(reason), which releases the guard and clears
the stored output and early terminal so a callback from the dropped session
cannot resurrect the abandoned submission after reconnecting. Its doc comment
states that the broadcast transaction may still be pending and the caller must
refresh the account nonce before sending again; clearing busy alone would
reintroduce the stale-nonce bug the guard exists to prevent. Adds an isBusy
getter so the guard state is inspectable.
Disconnect is guarded twice: the button is disabled while signing or tracking
with an explanatory tooltip, and handleLogout() returns early on the same
condition so a programmatic caller cannot bypass the UI.
Test added: tracking -> logout -> stale callback ignored -> login -> send
accepted -> done.
C2: the SendEgldOutput comment now says sessionId keys the
...TransactionsSessions() maps and identifies the per-session callbacks,
and names the flat hooks as taking no session id.
Verified on Node 20.19.0: advisory gate green (harness plus all five fresh
environments), 11/11 extractor tests, 4/4 lifecycle tests, strict TypeScript,
61/61 projects built, 8/8 Vite and 2/2 Next production builds, clean
Docusaurus build with no new broken links.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent 8890854 commit 45a223e
2 files changed
Lines changed: 119 additions & 4 deletions
File tree
- docs/sdk-and-tools/sdk-js/cookbook/start-here
- testing/cookbook-ts
Lines changed: 57 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
404 | 404 | | |
405 | 405 | | |
406 | 406 | | |
407 | | - | |
408 | | - | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
409 | 411 | | |
410 | 412 | | |
411 | 413 | | |
| |||
700 | 702 | | |
701 | 703 | | |
702 | 704 | | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
703 | 733 | | |
704 | 734 | | |
705 | 735 | | |
| |||
762 | 792 | | |
763 | 793 | | |
764 | 794 | | |
| 795 | + | |
| 796 | + | |
765 | 797 | | |
766 | 798 | | |
767 | 799 | | |
| |||
782 | 814 | | |
783 | 815 | | |
784 | 816 | | |
785 | | - | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
786 | 822 | | |
787 | 823 | | |
788 | 824 | | |
| |||
820 | 856 | | |
821 | 857 | | |
822 | 858 | | |
823 | | - | |
| 859 | + | |
824 | 860 | | |
825 | 861 | | |
826 | 862 | | |
| |||
845 | 881 | | |
846 | 882 | | |
847 | 883 | | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
848 | 891 | | |
849 | 892 | | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
850 | 897 | | |
851 | 898 | | |
852 | 899 | | |
| |||
893 | 940 | | |
894 | 941 | | |
895 | 942 | | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
896 | 949 | | |
897 | 950 | | |
898 | 951 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
0 commit comments