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

Replace handle<Xyz> methods in Dwn class with overloaded `process… #566

Merged
merged 3 commits into from
Oct 18, 2023

Conversation

shobitb
Copy link
Contributor

@shobitb shobitb commented Oct 18, 2023

…Message`

This commit fixes #563. It replaces the four methods in Dwn (1) handleRecordsWrite (2) handleRecordsQuery (3) handleRecordsRead (4) handleMessagesGet with the overloaded processMessage function introduced in commit #554.

This commit also replaces all invocations of the four deleted functions in all tests with the single processMessage. Note that because the new processMessage can't and doesn't use the expectedMethod or expectedInterface arguments in validateMessageIntegrity, any tests that are testing for incorrect method edge cases will receive errors from json schema invalidation (i.e., schema for x not found) rather than message integrity errors (i.e., Expected method x, received y)

…Message`

This commit fixes decentralized-identity#563. It removes the four methods in `Dwn` (1) `handleRecordsWrite` (2) `handleRecordsQuery` (3) `handleRecordsRead` (4) `handleMessagesGet` with the overloaded `processMessage` function introduced in commit decentralized-identity#554.

This commit also replaces all invocations of the four deleted functions in all tests with the single `processMessage`.  Note that because the new `processMessage` can't and doesn't use the `expectedMethod` or `expectedInterface` arguments in `validateMessageIntegrity`, any tests that are testing for incorrect method edge cases will receive errors from json schema invalidation (i.e., `schema for x not found`) rather than message integrity errors (i.e., `Expected method x, received y)
@codesandbox
Copy link

codesandbox bot commented Oct 18, 2023

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

Copy link

@diehuxx diehuxx 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. Thanks again @shobitb !

@diehuxx diehuxx merged commit f23bf02 into decentralized-identity:main Oct 18, 2023
4 checks passed
diehuxx pushed a commit to hkwi/dwn-sdk-js that referenced this pull request Oct 18, 2023
* main:
  Replace `handle<Xyz>` methods in `Dwn` class with overloaded `process… (decentralized-identity#566)
@EbonyLouis EbonyLouis added the hacktoberfest-accepted Accepted PRs for the hacking month of October label Oct 19, 2023
diehuxx pushed a commit that referenced this pull request Oct 20, 2023
* main:
  Add codecov coverage job in `integrity-check.yml` (#542)
  Add support for compressed secp256k1 publicKey (#567)
  Add range filter support for dataSize (#568)
  Replace `handle<Xyz>` methods in `Dwn` class with overloaded `process… (#566)
  Add tests for error cases in did-resolver.spec.ts (#561)
  add browser tests to gh actions. (#541)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted Accepted PRs for the hacking month of October
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove dedicated handleXyz() methods in Dwn class in favor of the generic processMessage
3 participants