Skip to content

Commit

Permalink
fix: avoid update metadata during atomic sync in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
ieow committed Oct 29, 2024
1 parent 45d7925 commit 4e88bd6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/mpcCoreKit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ export class Web3AuthMPCCoreKit implements ICoreKit {
return this.atomicSync(async () => {
await this.copyOrCreateShare(shareType, factorPub);
await this.backupMetadataShare(factorKey);
await this.addFactorDescription(factorKey, shareDescription, additionalMetadata);
await this.addFactorDescription(factorKey, shareDescription, additionalMetadata, false);

return scalarBNToBufferSEC1(factorKey).toString("hex");
}).catch((reason: Error) => {
Expand Down Expand Up @@ -951,9 +951,9 @@ export class Web3AuthMPCCoreKit implements ICoreKit {
// Store factor description.
await this.backupMetadataShare(factorKey);
if (this.options.disableHashedFactorKey) {
await this.addFactorDescription(factorKey, FactorKeyTypeShareDescription.Other);
await this.addFactorDescription(factorKey, FactorKeyTypeShareDescription.Other, undefined, false);
} else {
await this.addFactorDescription(factorKey, FactorKeyTypeShareDescription.HashedShare);
await this.addFactorDescription(factorKey, FactorKeyTypeShareDescription.HashedShare, undefined, false);
}
});
}
Expand Down

0 comments on commit 4e88bd6

Please sign in to comment.