fix: validate credentialStatus format only at sign, not verify - #106
Conversation
_checkCredential ran assertCredentialStatuses in both 'sign' and 'verify' modes. Since 2.4.0's assertTransferableRecords strictly requires an integer chainId (via assertIntegerChainId), a malformed tokenNetwork.chainId now throws during verify — and _checkCredential(mode: 'verify') is reached by isSignedDocument() and the DataIntegrity verifiers. That made a credential-status field problem masquerade as "document is not signed" / a signature-integrity failure. Gate the credentialStatus field-format validation to 'sign' mode. At verify the status is the concern of the dedicated status verifier (verifyCredentialStatus), so a malformed chainId now surfaces as a DOCUMENT_STATUS problem instead of a signature one. Sign-time validation is unchanged (still rejects a bad chainId at creation). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough
ChangesCredential status validation
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
## [2.4.1](https://github.com/TrustVC/w3c/compare/@trustvc/w3c-vc@2.4.0...@trustvc/w3c-vc@2.4.1) (2026-07-29) ### Bug Fixes * validate credentialStatus format only at sign, not verify ([#106](#106)) ([ade0b3e](ade0b3e))
|
🎉 This PR is included in version 2.4.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
## [2.4.1](https://github.com/TrustVC/w3c/compare/@trustvc/w3c@2.4.0...@trustvc/w3c@2.4.1) (2026-07-29) ### Bug Fixes * validate credentialStatus format only at sign, not verify ([#106](#106)) ([ade0b3e](ade0b3e))
|
🎉 This PR is included in version 2.4.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |



Summary by CodeRabbit