Skip to content

Commit

Permalink
Fix JavaScript error when a JSON-RPC response is generated while a ch…
Browse files Browse the repository at this point in the history
…ain is removed (#1512)

* Fix bug

* CHANGELOG
  • Loading branch information
tomaka authored Dec 23, 2023
1 parent 3ff5453 commit 914fb89
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions wasm-node/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- Fix state mismatch during warp syncing if a peer sends a bad header, justification, or proof. ([#1498](https://github.com/smol-dot/smoldot/pull/1498))
- Fix bugs in various corner cases when decoding and analyzing a Merkle proof. ([#1462](https://github.com/smol-dot/smoldot/pull/1462))
- Fix Merkle proofs being considered as invalid if they contain a storage value that happens to successfully decode as a trie node with an inline child. ([#1504](https://github.com/smol-dot/smoldot/pull/1504))
- Fix crash when using a worker due to race condition when a chain is removed while a JSON-RPC response is generated for it. ([#1512](https://github.com/smol-dot/smoldot/pull/1512))

## 2.0.15 - 2023-12-20

Expand Down
3 changes: 2 additions & 1 deletion wasm-node/javascript/src/internals/remote-instance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,10 @@ export async function connectToInstanceServer(config: ConnectConfig): Promise<in
case "json-rpc-response": {
const queue = state.jsonRpcResponses.get(message.chainId);
// The chain might have been removed locally in the past.
if (queue)
if (queue) {
queue.push(message.response);
config.eventCallback({ ty: "json-rpc-responses-non-empty", chainId: message.chainId })
}
return;
}
}
Expand Down

0 comments on commit 914fb89

Please sign in to comment.