Skip to content

Commit 1030ceb

Browse files
Merge pull request #155 from Concordium/fix-set-immediate
Fix use of setImmediate so that the common package
2 parents eeefb91 + c955956 commit 1030ceb

File tree

7 files changed

+20
-9
lines changed

7 files changed

+20
-9
lines changed

packages/common/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## 6.4.1 2023-03-31
4+
5+
- Replace use of `setImmediate` with `setTimeout` since the former is not
6+
supported in browsers.
7+
38
## 6.4.0 2023-03-22
49

510
### Added

packages/common/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@concordium/common-sdk",
3-
"version": "6.4.0",
3+
"version": "6.4.1",
44
"license": "Apache-2.0",
55
"engines": {
66
"node": ">=14.16.0"

packages/common/src/GRPCClient.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ export default class ConcordiumNodeClient {
435435
if (response.status === 'finalized') {
436436
// Simply doing `abortController.abort()` causes an error.
437437
// See: https://github.com/grpc/grpc-node/issues/1652
438-
setImmediate(() => abortController.abort());
438+
setTimeout(() => abortController.abort(), 0);
439439
return resolve(response.outcome.blockHash);
440440
}
441441

@@ -446,7 +446,7 @@ export default class ConcordiumNodeClient {
446446
transactionHash
447447
);
448448
if (response.status === 'finalized') {
449-
setImmediate(() => abortController.abort());
449+
setTimeout(() => abortController.abort(), 0);
450450
return resolve(response.outcome.blockHash);
451451
}
452452
}

packages/nodejs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"build-dev": "tsc"
6161
},
6262
"dependencies": {
63-
"@concordium/common-sdk": "6.4.0",
63+
"@concordium/common-sdk": "6.4.1",
6464
"@grpc/grpc-js": "^1.3.4",
6565
"@protobuf-ts/grpc-transport": "^2.8.2",
6666
"buffer": "^6.0.3",

packages/web/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## 3.4.1 2023-3-31
4+
5+
### Changed
6+
7+
- Bumped @concordium/common-sdk to 6.4.1. (Fixes `waitForTransactionFinalization`)
8+
39
## 3.4.0 2023-3-22
410

511
### Changed

packages/web/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@concordium/web-sdk",
3-
"version": "3.4.0",
3+
"version": "3.4.1",
44
"license": "Apache-2.0",
55
"browser": "lib/concordium.min.js",
66
"types": "lib/index.d.ts",
@@ -48,7 +48,7 @@
4848
"webpack-cli": "^4.9.2"
4949
},
5050
"dependencies": {
51-
"@concordium/common-sdk": "6.4.0",
51+
"@concordium/common-sdk": "6.4.1",
5252
"@concordium/rust-bindings": "0.11.0",
5353
"@grpc/grpc-js": "^1.3.4",
5454
"@protobuf-ts/grpcweb-transport": "^2.8.2",

yarn.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,7 +1312,7 @@ __metadata:
13121312
languageName: node
13131313
linkType: hard
13141314

1315-
"@concordium/[email protected].0, @concordium/common-sdk@workspace:packages/common":
1315+
"@concordium/[email protected].1, @concordium/common-sdk@workspace:packages/common":
13161316
version: 0.0.0-use.local
13171317
resolution: "@concordium/common-sdk@workspace:packages/common"
13181318
dependencies:
@@ -1354,7 +1354,7 @@ __metadata:
13541354
version: 0.0.0-use.local
13551355
resolution: "@concordium/node-sdk@workspace:packages/nodejs"
13561356
dependencies:
1357-
"@concordium/common-sdk": 6.4.0
1357+
"@concordium/common-sdk": 6.4.1
13581358
"@grpc/grpc-js": ^1.3.4
13591359
"@noble/ed25519": ^1.7.1
13601360
"@protobuf-ts/grpc-transport": ^2.8.2
@@ -1393,7 +1393,7 @@ __metadata:
13931393
version: 0.0.0-use.local
13941394
resolution: "@concordium/web-sdk@workspace:packages/web"
13951395
dependencies:
1396-
"@concordium/common-sdk": 6.4.0
1396+
"@concordium/common-sdk": 6.4.1
13971397
"@concordium/rust-bindings": 0.11.0
13981398
"@grpc/grpc-js": ^1.3.4
13991399
"@protobuf-ts/grpcweb-transport": ^2.8.2

0 commit comments

Comments
 (0)