Skip to content

Commit

Permalink
[IRT-1265] fix: Ensure write metadata lock is released
Browse files Browse the repository at this point in the history
  • Loading branch information
huggingbot committed Apr 9, 2024
1 parent 9319136 commit b5f54d0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/core/src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1429,14 +1429,14 @@ class ThresholdKey implements ITKey {
privKey: this._localMetadataTransitions[0],
serviceProvider: this.serviceProvider,
});
this._localMetadataTransitions = [[], []];
this.lastFetchedCloudMetadata = this.metadata.clone();
} catch (error: unknown) {
throw CoreError.metadataPostFailed(prettyPrintError(error as Error));
} finally {
// release lock
if (acquiredLock) await this.releaseWriteMetadataLock();
}

this._localMetadataTransitions = [[], []];
this.lastFetchedCloudMetadata = this.metadata.clone();
// release lock
if (acquiredLock) await this.releaseWriteMetadataLock();
}

// Returns a new instance of metadata with a clean state. All the previous state will be reset.
Expand Down

0 comments on commit b5f54d0

Please sign in to comment.