Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/connect-multichain/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- `ConnectMultichain` now waits 10 seconds (rather than 2 minutes) when attempting to resume a pending connection on initial instantiation via `createMultichainClient()` ([#175](https://github.com/MetaMask/connect-monorepo/pull/175))
- Fix `beforeunload` event listener not being properly removed on disconnect due to `.bind()` creating different function references, causing a listener leak on each connect/disconnect cycle ([#170](https://github.com/MetaMask/connect-monorepo/pull/170))
- Rename `StoreAdapterWeb.DB_NAME` from `mmsdk` to `mmconnect` to prevent IndexedDB collisions when the legacy MetaMask SDK and MM Connect run in the same browser context ([#177](https://github.com/MetaMask/connect-monorepo/pull/177))
- Clean up stale MWP session from KVStore on connection rejection so subsequent QR code connection attempts are not blocked ([#180](https://github.com/MetaMask/connect-monorepo/pull/180))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,8 @@
logger('active session found', session);
}

const storedSessionRequestBeforeConnectionAttempt = await this.getStoredSessionRequest();

Check failure on line 422 in packages/connect-multichain/src/multichain/transports/mwp/index.ts

View workflow job for this annotation

GitHub Actions / Lint, build, and test / Lint (22.x)

Insert `⏎·····`

let timeout: NodeJS.Timeout;
let initialConnectionMessageHandler:
| ((message: unknown) => Promise<void>)
Expand Down Expand Up @@ -516,11 +518,17 @@
});
},
);
}

Check failure on line 521 in packages/connect-multichain/src/multichain/transports/mwp/index.ts

View workflow job for this annotation

GitHub Actions / Lint, build, and test / Lint (22.x)

Delete `⏎`

timeout = setTimeout(() => {
reject(new TransportTimeoutError());
}, this.options.connectionTimeout);

timeout = setTimeout(
() => {
reject(new TransportTimeoutError());
},
storedSessionRequestBeforeConnectionAttempt
? this.options.resumeTimeout
: this.options.connectionTimeout,
);

connection.then(resolve).catch(reject);
});
Expand Down
Loading