Skip to content

Commit e7ea2c0

Browse files
authored
fix: stop caching error responses (#59)
* Do not cache error response * changelog
1 parent 53e9b9a commit e7ea2c0

3 files changed

Lines changed: 11 additions & 0 deletions

File tree

packages/connect-evm/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Fixed
11+
12+
- Fixed incorrect caching of error responses for some requests/events ([#59](https://github.com/MetaMask/connect-monorepo/pull/59))
13+
1014
## [0.1.0]
1115

1216
### Added

packages/connect-multichain/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Fixed
11+
12+
- Fixed incorrect caching of error responses for some requests/events ([#59](https://github.com/MetaMask/connect-monorepo/pull/59))
13+
1014
## [0.3.0]
1115

1216
### Changed

packages/connect-multichain/src/multichain/transports/mwp/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,9 @@ export class MWPTransport implements ExtendedTransport {
522522
request: TransportRequest,
523523
response: TransportResponse,
524524
): Promise<void> {
525+
if(response.error) {
526+
return;
527+
}
525528
if (CACHED_METHOD_LIST.includes(request.method)) {
526529
await this.kvstore.set(SESSION_STORE_KEY, JSON.stringify(response));
527530
} else if (request.method === 'eth_accounts') {

0 commit comments

Comments
 (0)