Skip to content

Commit

Permalink
did-resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
LiranCohen committed Oct 10, 2024
1 parent 5c17558 commit f7920ef
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/agent/src/agent-did-resolver-cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,10 @@ export class AgentDidResolverCache extends DidResolverCacheLevel implements DidR
metadata : result.didDocumentMetadata,
};

// this will throw an error if the DID is not managed by the agent, or there is no difference between the stored and resolved DID
try {
await this.agent.did.update({ portableDid, tenant: this.agent.agentDid.uri });
// this will throw an error if the DID is not managed by the agent, or there is no difference between the stored and resolved DID
// We don't publish the DID in this case, as it was received by the resolver.
await this.agent.did.update({ portableDid, tenant: this.agent.agentDid.uri, publish: false });
} catch(error: any) {
// if the error is not due to no changes detected, log the error
if (error.message && !error.message.includes('No changes detected, update aborted')) {
Expand Down

0 comments on commit f7920ef

Please sign in to comment.