Skip to content

Conversation

@reinkrul
Copy link
Member

Fixes #3967

@qltysh
Copy link

qltysh bot commented Jan 14, 2026

2 new issues

Tool Category Rule Count
qlty Structure Function with many returns (count = 6): SearchIssuedVCs 2

@qltysh
Copy link

qltysh bot commented Jan 15, 2026

Qlty

Coverage Impact

⬇️ Merging this pull request will decrease total coverage on master by 0.02%.

Modified Files with Diff Coverage (3)

RatingFile% DiffUncovered Line #s
Coverage rating: A Coverage rating: A
vcr/api/vcr/v2/api.go75.0%262-263
Coverage rating: B Coverage rating: B
vcr/issuer/issuer.go92.6%113-114
Coverage rating: C Coverage rating: C
vcr/revocation/statuslist2021_issuer.go95.0%479
Total90.9%
🤖 Increase coverage with AI coding...

In the `iss3967-issued-vc-status` branch, add test coverage for this new code:

- `vcr/api/vcr/v2/api.go` -- Line 262-263
- `vcr/issuer/issuer.go` -- Line 113-114
- `vcr/revocation/statuslist2021_issuer.go` -- Line 479

🚦 See full report on Qlty Cloud »

🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

StatusList(ctx context.Context, issuer did.DID, page int) (*vc.VerifiableCredential, error)
// GetRevocation returns a revocation for a credential ID.
// Returns a types.ErrNotFound when the revocation is not in the store
// Returns a types.ErrMultipleFound when there are multiple revocations for this credential ID in the store
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why this could be possible, but even if there are more, can we not just return the most recent? It is still revoked. If there are more, this specific credential will be broken since there probably is no way of fixing this error.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did it this way to have it consistent with the did:nuts storage, but I think the same way. revoked=revoked, doesn't really matter if it's revoked multiple times.

I'll change the implementations.

})
}

func Test_issuer_GetRevocation(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you test the multiple revocations here as well?

Select("status_list_credential.status_purpose, status_list_entry.created_at").
Joins("JOIN status_list_credential ON status_list_entry.status_list_credential = status_list_credential.subject_id").
Where("status_list_entry.credential_id = ?", credentialID.String()).
First(&result).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we somehow create a unique index on the table so that is would be impossible to have multiple revocations per VC?

Copy link
Member

@stevenvegt stevenvegt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how the ErrMultipleFound can be caused and fixed. But I prefer a setup in which this error should not be possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

VCR.SearchIssuedVCs(): revocation status is incorrect for did:web credentials

3 participants