Commit f157c3e
fix(expo-example): passphrase session-count test transport race on chain switch (#762)
The passphrase session-count test hit "Didn't receive expected header
signature." when switching chains between runs. Root cause: the stop
path fired an un-awaited SDK.cancel() followed by a fire-and-forget
SDK.getFeatures(), triggered synchronously inside the REQUEST_PASSPHRASE
listener while the device was still mid-exchange. The next run's
getFeatures then decoded leftover bytes from that race.
Align with the recovery pattern used in blindSignature/automationTest
timeout handlers (cancel(connectId) + awaited getFeatures with
retryCount):
- stopTest: async; SDK.cancel(connectId) then await
SDK.getFeatures(connectId, { retryCount: 1 }) drains the transport
to a known-clean frame boundary. Removes the dead-code try/catch
around the fire-and-forget getFeatures.
- testSessionCount entry: defensive SDK.cancel(connectId) + awaited
getFeatures with retryCount so a dirty transport from a prior run
(or prior chain) can't blow up the first request.
- REQUEST_PASSPHRASE listener end-branch: instead of synchronously
calling stopTest (which raced cancel against the pending UI
exchange), reply with an empty passphrase so the device's current
call completes cleanly, flip hasContinue, and let the outer loop
drop out.
- Verification loop: check hasContinue around the awaited request so a
round ended by the listener mid-verification exits silently instead
of logging a spurious "address not match".
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent f2190c5 commit f157c3e
1 file changed
Lines changed: 53 additions & 8 deletions
File tree
- packages/connect-examples/expo-example/src/testTools/passphraseTest
Lines changed: 53 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
| 109 | + | |
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
114 | 113 | | |
115 | 114 | | |
116 | 115 | | |
| |||
120 | 119 | | |
121 | 120 | | |
122 | 121 | | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
123 | 131 | | |
124 | | - | |
125 | | - | |
126 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
127 | 136 | | |
128 | 137 | | |
129 | 138 | | |
| |||
137 | 146 | | |
138 | 147 | | |
139 | 148 | | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
140 | 157 | | |
141 | | - | |
| 158 | + | |
142 | 159 | | |
143 | 160 | | |
144 | 161 | | |
| |||
163 | 180 | | |
164 | 181 | | |
165 | 182 | | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
166 | 191 | | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
167 | 196 | | |
168 | 197 | | |
169 | 198 | | |
| |||
173 | 202 | | |
174 | 203 | | |
175 | 204 | | |
176 | | - | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
177 | 212 | | |
178 | 213 | | |
179 | 214 | | |
| |||
281 | 316 | | |
282 | 317 | | |
283 | 318 | | |
| 319 | + | |
| 320 | + | |
284 | 321 | | |
285 | 322 | | |
286 | 323 | | |
| |||
297 | 334 | | |
298 | 335 | | |
299 | 336 | | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
300 | 343 | | |
301 | 344 | | |
302 | 345 | | |
| |||
342 | 385 | | |
343 | 386 | | |
344 | 387 | | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
345 | 391 | | |
346 | 392 | | |
347 | 393 | | |
| |||
356 | 402 | | |
357 | 403 | | |
358 | 404 | | |
359 | | - | |
360 | 405 | | |
361 | 406 | | |
362 | 407 | | |
| |||
0 commit comments