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

Add Dwn.handleRecordsDelete function #549

Closed
wants to merge 4 commits into from

Conversation

shobitb
Copy link
Contributor

@shobitb shobitb commented Oct 7, 2023

This commit introduces a handleRecordsDelete function meant to be used in place of the existing processMessage (which is eventually meant to be replaced, as described in issue #289).

This commit also updates the relevant tests in records-(write|delete|read).ts files, which were using processMessage and replaces its usage with the new handleRecordsDelete.

It also introduces a test in dwn.spec.ts, enough to bring uncovered lines of this new function to 0 (more specifically, the new test is meant to cover the exception path).

This commit introduces a handleRecordsDelete function meant to be used in place of the existing processMessage (which is eventually meant to be replaced, as described in issue decentralized-identity#289).

This commit also updates the relevant tests in records-(write|delete|read).ts files, which were using processMessage and replaces its usage with the new handleRecordsDelete.

It also introduces a test in dwn.spec.ts, enough to bring uncovered lines of this new function to 0 (more specifically, the new test is meant to cover the exception path).
@codesandbox
Copy link

codesandbox bot commented Oct 7, 2023

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

thehenrytsai
thehenrytsai previously approved these changes Oct 12, 2023
Copy link
Contributor

@thehenrytsai thehenrytsai left a comment

Choose a reason for hiding this comment

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

🙏 🎖️ 💯

@shobitb
Copy link
Contributor Author

shobitb commented Oct 13, 2023

@thehenrytsai thanks for reviewing and approving! I merged it, but had to resolve a conflict. I think it needs another review.

Copy link
Contributor

@thehenrytsai thehenrytsai left a comment

Choose a reason for hiding this comment

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

Approved! So FYI, @diehuxx made a change (#554) which uses a clever alternate scheme to provide TS type info.

So we can put a hold on the rest of the methods if it turns out to be sufficient! The work might then end up being to remove all dedicated methods such as this one instead. But for now, the PR is good to merge!

@shobitb
Copy link
Contributor Author

shobitb commented Oct 13, 2023

Wow, nice! I learned something new about method overloading in TS today. That's indeed very clever @diehuxx!

@thehenrytsai I don't have permissions to merge this above PR, but feel free to discard if you think that's the right direction anyway.

Thanks.

@EbonyLouis EbonyLouis added the hacktoberfest-accepted Accepted PRs for the hacking month of October label Oct 16, 2023
@thehenrytsai
Copy link
Contributor

@shobitb thanks so much for your understanding! In which case, I am going to close the PR. I have created #563 to track the new work, which would be perfect for you to work on (only if you are interested of course) now that you have the full context.

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.

3 participants