diff --git a/package-lock.json b/package-lock.json index 9ce0bd437..675037e0e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "polykey", - "version": "2.3.4", + "version": "2.3.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "polykey", - "version": "2.3.4", + "version": "2.3.5", "license": "GPL-3.0", "dependencies": { "@matrixai/async-cancellable": "^2.0.1", diff --git a/package.json b/package.json index eafa990f3..6ff19843f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polykey", - "version": "2.3.4", + "version": "2.3.5", "homepage": "https://polykey.com", "author": "Matrix AI", "contributors": [ diff --git a/src/nodes/NodeManager.ts b/src/nodes/NodeManager.ts index 486d1389f..e85de4dec 100644 --- a/src/nodes/NodeManager.ts +++ b/src/nodes/NodeManager.ts @@ -310,7 +310,7 @@ class NodeManager { connectedTime: Date.now(), scopes: ['global'], }, - true, + false, false, ); }; @@ -707,7 +707,6 @@ class NodeManager { } while (true) { - ctx.signal.throwIfAborted(); const isDone = await nodeConnectionsQueue.withNodeSignal( async (nodeIdTarget, nodeIdSignaller) => { let nodeConnection: NodeConnection | undefined; @@ -849,7 +848,6 @@ class NodeManager { } while (true) { - ctx.signal.throwIfAborted(); const isDone = await nodeConnectionsQueue.withNodeDirect( async (nodeIdTarget, nodeContact) => { if (!this.nodeConnectionManager.hasConnection(nodeIdTarget)) { @@ -924,7 +922,6 @@ class NodeManager { throw e; }); } - if (!connectionMade) { throw new nodesErrors.ErrorNodeManagerFindNodeFailed( 'failed to find node via direct', @@ -1312,8 +1309,8 @@ class NodeManager { @decorators.context ctx: ContextTimed, ): Promise { if (tran == null) { - return this.db.withTransactionF((tran) => { - return this.claimNode(targetNodeId, tran); + return await this.db.withTransactionF(async (tran) => { + return await this.claimNode(targetNodeId, tran); }); } const [, claim] = await this.sigchain.addClaim( @@ -1515,8 +1512,9 @@ class NodeManager { tran?: DBTransaction, ): Promise> { if (tran == null) { - return this.db.withTransactionF((tran) => - this.handleClaimNetwork(requestingNodeId, input, tran), + return await this.db.withTransactionF( + async (tran) => + await this.handleClaimNetwork(requestingNodeId, input, tran), ); } const signedClaim = claimsUtils.parseSignedClaim(input.signedTokenEncoded); @@ -1546,8 +1544,9 @@ class NodeManager { tran?: DBTransaction, ): Promise> { if (tran == null) { - return this.db.withTransactionF((tran) => - this.handleVerifyClaimNetwork(requestingNodeId, input, tran), + return await this.db.withTransactionF( + async (tran) => + await this.handleVerifyClaimNetwork(requestingNodeId, input, tran), ); } const signedClaim = claimsUtils.parseSignedClaim(input.signedTokenEncoded); @@ -1680,17 +1679,18 @@ class NodeManager { } if (tran == null) { - return this.db.withTransactionF((tran) => - this.setNode( - nodeId, - nodeAddress, - nodeContactAddressData, - block, - force, - connectionConnectTimeoutTime, - tran, - ctx, - ), + return await this.db.withTransactionF( + async (tran) => + await this.setNode( + nodeId, + nodeAddress, + nodeContactAddressData, + block, + force, + connectionConnectTimeoutTime, + tran, + ctx, + ), ); } @@ -1824,13 +1824,14 @@ class NodeManager { tran?: DBTransaction, ): Promise { if (tran == null) { - return this.db.withTransactionF((tran) => - this.garbageCollectBucket( - bucketIndex, - connectionConnectTimeoutTime, - ctx, - tran, - ), + return await this.db.withTransactionF( + async (tran) => + await this.garbageCollectBucket( + bucketIndex, + connectionConnectTimeoutTime, + ctx, + tran, + ), ); } @@ -2041,8 +2042,8 @@ class NodeManager { protected async setupRefreshBucketTasks(tran?: DBTransaction) { if (tran == null) { - return this.db.withTransactionF((tran) => - this.setupRefreshBucketTasks(tran), + return await this.db.withTransactionF( + async (tran) => await this.setupRefreshBucketTasks(tran), ); } @@ -2149,8 +2150,15 @@ class NodeManager { @decorators.context ctx: ContextTimed, ): Promise { if (tran == null) { - return this.db.withTransactionF((tran) => - this.updateRefreshBucketDelay(bucketIndex, delay, lazy, tran, ctx), + return await this.db.withTransactionF( + async (tran) => + await this.updateRefreshBucketDelay( + bucketIndex, + delay, + lazy, + tran, + ctx, + ), ); }