Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: address edge case when getting DIDDoc component #1365

Merged
merged 1 commit into from
Mar 28, 2024

Conversation

nickreynolds
Copy link
Contributor

What issue is this PR fixing

fixes #1364

What is being changed

The getDIDComponentById function in did-resolver/src/resolver.ts is modified so that it correctly finds the result when the didUrl passed in is a keyID without the DID prefixed to it, but the resolved DID Document lists the key with the prefix.

Quality

Check all that apply:

  • I want these changes to be integrated
  • I successfully ran pnpm i, pnpm build, pnpm test, pnpm test:browser locally.
  • I allow my PR to be updated by the reviewers (to speed up the review process).
  • I added unit tests.
  • I added integration tests.
  • I did not add automated tests because I am unable to reproduce this error in unit tests, and I am aware that a PR without tests will likely get rejected.

Details

it's possible that this is not the ideal solution and the proper fix for the bug is upstream from this function

@nickreynolds nickreynolds requested a review from mirceanis March 27, 2024 23:28
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.95%. Comparing base (ab16cbd) to head (7d1ad28).

Additional details and impacted files
@@           Coverage Diff           @@
##             next    #1365   +/-   ##
=======================================
  Coverage   89.95%   89.95%           
=======================================
  Files         176      176           
  Lines       27695    27695           
  Branches     2200     2200           
=======================================
  Hits        24912    24912           
  Misses       2783     2783           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@mirceanis mirceanis left a comment

Choose a reason for hiding this comment

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

Looks good.
It would be nice to add a test case for this

@nickreynolds nickreynolds force-pushed the nickreynolds/get-component-fix branch from 7d1ad28 to b23a5fe Compare March 28, 2024 14:39
@nickreynolds nickreynolds merged commit 1694de1 into next Mar 28, 2024
9 checks passed
@nickreynolds nickreynolds deleted the nickreynolds/get-component-fix branch March 28, 2024 15:00
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.

4 participants