Merge branch 'sleepingWizard' into 'master'
Dedup connection: conn.dappDiscovered = false; See merge request riftenlabs/lib/wizardconnect!17
This commit is contained in:
commit
3af76d5653
2 changed files with 9 additions and 3 deletions
|
|
@ -121,8 +121,11 @@ a ready message from the other side in this runtime session."
|
|||
"ready" — *even if it already sent one* — because the other side has lost state and needs
|
||||
a fresh delivery.
|
||||
4. The wallet guards against duplicate `wallet_ready` messages within a single connection cycle
|
||||
via `walletReadySentThisCycle`. This resets to `false` on each new connect/reconnect.
|
||||
Receiving `dapp_ready(wallet_discovered=false)` also resets this flag.
|
||||
via `walletReadySentThisCycle`. Both `walletReadySentThisCycle` and `dappDiscovered` reset to
|
||||
`false` on each new connect/reconnect. This ensures the wallet always sends
|
||||
`wallet_ready(dapp_discovered=false)` at the start of a new connection cycle, matching the
|
||||
"Wallet reconnects" scenario. Receiving `dapp_ready(wallet_discovered=false)` also resets
|
||||
`walletReadySentThisCycle`.
|
||||
|
||||
#### Scenarios
|
||||
|
||||
|
|
|
|||
|
|
@ -290,8 +290,11 @@ export class WalletConnectionManager extends EventEmitter<WalletConnectionManage
|
|||
}
|
||||
|
||||
private onConnected(conn: ActiveConnection): void {
|
||||
// New connection cycle: reset dedup flag so wallet_ready is sent fresh
|
||||
// New connection cycle: reset dedup flags so wallet_ready is sent fresh
|
||||
// and dapp_discovered is false — the dapp must re-send dapp_ready to
|
||||
// re-establish the session (matches "Wallet reconnects" scenario in protocol.md).
|
||||
conn.walletReadySentThisCycle = false;
|
||||
conn.dappDiscovered = false;
|
||||
|
||||
// Start notification processor as fallback for retries after send errors
|
||||
if (conn.notificationProcessor) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue