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: query the record by credential and proof role #1784

Conversation

berendsliedrecht
Copy link
Contributor

@berendsliedrecht berendsliedrecht commented Mar 1, 2024

  • Missed in the last PR regarding issuance to self. We also have to make sure when finding the credential, or proof, exchange record, that the role is correct otherwise we will find multiple instances with the same connection id and thread id.
  • Fixed some of the deprecated jest functions (just the ones I came across).

@berendsliedrecht berendsliedrecht force-pushed the query-record-with-role branch from 0eae1c6 to 6f0a374 Compare March 1, 2024 13:42
@berendsliedrecht berendsliedrecht requested review from genaris and TimoGlastra and removed request for genaris March 1, 2024 14:03
* @throws {RecordNotFoundError} If no record is found
* @throws {RecordDuplicateError} If multiple records are found
* @returns The credential record
*/
public getByThreadAndConnectionId(
public getByThreadIdConnectionIdAndRole(
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it is a bit confusing this method to be called getByThreadIdConnectionIdAndRole if it's expecting the role before the connectionId. What about swapping the parameters, renaming it or use an options object like we usually do?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I didn't do an object to not make too many changes. But I think that that would be the correct call (using a bunch of optional parameter causes a bug in this PR earlier and an object would've caught that).

I do think when it's an object I will rename it to getByQueryFilter or something equivalent. This would allow to have more options in the future as well. Also happy to pick another name :).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@genaris I updated it to getByProperties and findByProperties. This'll make it expandable in the future as well. Is that good?

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, I was just complaining about the order of the parameters, but like this is better of course!

@berendsliedrecht berendsliedrecht requested a review from genaris March 4, 2024 11:57
@berendsliedrecht berendsliedrecht merged commit d2b5cd9 into openwallet-foundation:main Mar 4, 2024
12 checks passed
@berendsliedrecht berendsliedrecht deleted the query-record-with-role branch March 4, 2024 14:01
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.

2 participants