Summary
In did.service.ts, the assignment that persists the created DID to the wallet entity is commented out:
// wallet.publicDid = didDocument.id
await this.em.flush()
The flush runs but publicDid is never set, so every wallet is saved with publicDid: null after DID creation.
Consequences
Duplicate DID guard never triggers
createDid() checks if (wallet.publicDid) at the top and throws if a DID already exists. Since publicDid is always null, the same wallet can create multiple DIDs on Hedera repeatedly.
Controller resolution always fails for OrgAdmin and Iss<!-- <!-- uer
Both roles require a controller wallet with a valid publicDid. Since no wallet ever has it set, the check:
if (!didControllerWallet || !didControllerWallet.publicDid)
always throws — meaning OrgAdmin and Issuer DID creation is permanently broken.
Test suite masks the bug
Tests mock publicDid as already set, so no test ever exercises the real assignment path. CI stays green.
Fix
- Uncomment the assignment before the flush:
wallet.publicDid = didDocument.id
await this.em.flush()
A test verifying publicDid is set after createDid() completes should accompany the fix. -->
Summary
In
did.service.ts, the assignment that persists the created DID to the wallet entity is commented out:The flush runs but
publicDidis never set, so every wallet is saved withpublicDid: nullafter DID creation.Consequences
Duplicate DID guard never triggers
createDid()checksif (wallet.publicDid)at the top and throws if a DID already exists. SincepublicDidis alwaysnull, the same wallet can create multiple DIDs on Hedera repeatedly.Controller resolution always fails for OrgAdmin and Iss<!-- <!-- uer
Both roles require a controller wallet with a valid
publicDid. Since no wallet ever has it set, the check:always throws — meaning OrgAdmin and Issuer DID creation is permanently broken.
Test suite masks the bug
Tests mock
publicDidas already set, so no test ever exercises the real assignment path. CI stays green.Fix
A test verifying
publicDidis set aftercreateDid()completes should accompany the fix. -->