Skip to content

Commit

Permalink
Merge pull request #155 from Concordium/fix-set-immediate
Browse files Browse the repository at this point in the history
Fix use of setImmediate so that the common package
  • Loading branch information
shjortConcordium authored Mar 31, 2023
2 parents eeefb91 + c955956 commit 1030ceb
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 9 deletions.
5 changes: 5 additions & 0 deletions packages/common/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 6.4.1 2023-03-31

- Replace use of `setImmediate` with `setTimeout` since the former is not
supported in browsers.

## 6.4.0 2023-03-22

### Added
Expand Down
2 changes: 1 addition & 1 deletion packages/common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@concordium/common-sdk",
"version": "6.4.0",
"version": "6.4.1",
"license": "Apache-2.0",
"engines": {
"node": ">=14.16.0"
Expand Down
4 changes: 2 additions & 2 deletions packages/common/src/GRPCClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ export default class ConcordiumNodeClient {
if (response.status === 'finalized') {
// Simply doing `abortController.abort()` causes an error.
// See: https://github.com/grpc/grpc-node/issues/1652
setImmediate(() => abortController.abort());
setTimeout(() => abortController.abort(), 0);
return resolve(response.outcome.blockHash);
}

Expand All @@ -446,7 +446,7 @@ export default class ConcordiumNodeClient {
transactionHash
);
if (response.status === 'finalized') {
setImmediate(() => abortController.abort());
setTimeout(() => abortController.abort(), 0);
return resolve(response.outcome.blockHash);
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/nodejs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"build-dev": "tsc"
},
"dependencies": {
"@concordium/common-sdk": "6.4.0",
"@concordium/common-sdk": "6.4.1",
"@grpc/grpc-js": "^1.3.4",
"@protobuf-ts/grpc-transport": "^2.8.2",
"buffer": "^6.0.3",
Expand Down
6 changes: 6 additions & 0 deletions packages/web/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 3.4.1 2023-3-31

### Changed

- Bumped @concordium/common-sdk to 6.4.1. (Fixes `waitForTransactionFinalization`)

## 3.4.0 2023-3-22

### Changed
Expand Down
4 changes: 2 additions & 2 deletions packages/web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@concordium/web-sdk",
"version": "3.4.0",
"version": "3.4.1",
"license": "Apache-2.0",
"browser": "lib/concordium.min.js",
"types": "lib/index.d.ts",
Expand Down Expand Up @@ -48,7 +48,7 @@
"webpack-cli": "^4.9.2"
},
"dependencies": {
"@concordium/common-sdk": "6.4.0",
"@concordium/common-sdk": "6.4.1",
"@concordium/rust-bindings": "0.11.0",
"@grpc/grpc-js": "^1.3.4",
"@protobuf-ts/grpcweb-transport": "^2.8.2",
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1312,7 +1312,7 @@ __metadata:
languageName: node
linkType: hard

"@concordium/[email protected].0, @concordium/common-sdk@workspace:packages/common":
"@concordium/[email protected].1, @concordium/common-sdk@workspace:packages/common":
version: 0.0.0-use.local
resolution: "@concordium/common-sdk@workspace:packages/common"
dependencies:
Expand Down Expand Up @@ -1354,7 +1354,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@concordium/node-sdk@workspace:packages/nodejs"
dependencies:
"@concordium/common-sdk": 6.4.0
"@concordium/common-sdk": 6.4.1
"@grpc/grpc-js": ^1.3.4
"@noble/ed25519": ^1.7.1
"@protobuf-ts/grpc-transport": ^2.8.2
Expand Down Expand Up @@ -1393,7 +1393,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@concordium/web-sdk@workspace:packages/web"
dependencies:
"@concordium/common-sdk": 6.4.0
"@concordium/common-sdk": 6.4.1
"@concordium/rust-bindings": 0.11.0
"@grpc/grpc-js": ^1.3.4
"@protobuf-ts/grpcweb-transport": ^2.8.2
Expand Down

0 comments on commit 1030ceb

Please sign in to comment.