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

EventsQuery by protocol #762

Merged
merged 9 commits into from
Jun 21, 2024
Merged

Conversation

LiranCohen
Copy link
Member

@LiranCohen LiranCohen commented Jun 19, 2024

This PR is to implement a protocol filter for the EventsQuery interface which accounts for receiving permission messages scoped to the filtered protocol via tag filters, as well as other messages directly indexed to the protocol.

It also resolves this issue #663, which simplifies the type of filters EventsQuery implements to reduce complexity of which messages may or may not be returned with the filter.

Since EventsQuery is being used for sync/selective sync, the protocol filter is most important, if further filters are needed down the line, we will implement them according to scenarios put in place so we can make sure the correct messages arrive with the query results.

The Additional filters I left are for interface, method and messageTimestamp which are compatible with all types of messages.

NOTE: I cleaned up something I didn't like with EventsQuery from the prior PR instead of the message descriptor having an undefined filter, it is forced to have an empty filters array.

NOTE2: EventsSubscribe does not yet handle filtering for protocols which include the permissions messages, that will be done in a separate PR.

@LiranCohen LiranCohen force-pushed the lirancohen/events-query-by-protocol branch from a2ed885 to babbd40 Compare June 20, 2024 18:17
@LiranCohen LiranCohen marked this pull request as ready for review June 20, 2024 20:27
@LiranCohen LiranCohen force-pushed the lirancohen/events-query-by-protocol branch from e07830b to 159dfa4 Compare June 20, 2024 20:30
@LiranCohen LiranCohen force-pushed the lirancohen/events-query-by-protocol branch from 159dfa4 to 18069cd Compare June 20, 2024 20:31
src/utils/events.ts Outdated Show resolved Hide resolved
src/utils/events.ts Outdated Show resolved Hide resolved
src/utils/events.ts Outdated Show resolved Hide resolved
src/utils/events.ts Outdated Show resolved Hide resolved
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.

You really did go all out at removing loads of tests!

Just a couple of comments on renaming/rewording.

@codecov-commenter
Copy link

codecov-commenter commented Jun 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.64%. Comparing base (8446cdb) to head (7e44b50).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #762   +/-   ##
=======================================
  Coverage   98.64%   98.64%           
=======================================
  Files          71       71           
  Lines       10893    10899    +6     
  Branches     1577     1564   -13     
=======================================
+ Hits        10745    10751    +6     
  Misses        142      142           
  Partials        6        6           

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

@LiranCohen
Copy link
Member Author

@thehenrytsai addressed the review comments, and also created and added a reference to this issue:
#768 for indexing RecordsDelete messages associated with permission requests/grants/revocations.

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.

🐐 🚀

@LiranCohen LiranCohen merged commit 92b6792 into main Jun 21, 2024
4 checks passed
@LiranCohen LiranCohen deleted the lirancohen/events-query-by-protocol branch June 21, 2024 16:55
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.

3 participants