-
Notifications
You must be signed in to change notification settings - Fork 315
feat(indexeddb): implement Event
-related functions in EventCacheStore
#5414
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
feat(indexeddb): implement Event
-related functions in EventCacheStore
#5414
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## main #5414 +/- ##
==========================================
- Coverage 88.85% 88.85% -0.01%
==========================================
Files 333 333
Lines 91547 91547
Branches 91547 91547
==========================================
- Hits 81343 81340 -3
- Misses 6379 6382 +3
Partials 3825 3825 ☔ View full report in Codecov by Sentry. |
Thanks for the PR! Stealing review, as I'm more acquainted with the event cache. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry about the long review time! Holidays make it so that there are fewer of us working around this time.
Looks good in general, there's a tiny logic issue in the first commit, but the rest looks great, thanks!
crates/matrix-sdk-indexeddb/src/event_cache_store/serializer/types.rs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, with the linked-chunk-id keying postponed to later, LGTM 👍
Event
-related functions in EventCacheStore
Event
-related functions in EventCacheStore
…r_duplicated_events Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
…event Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
…event Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
… item already exists Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
…event_relations Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
4799ce1
to
45db71f
Compare
Background
This pull request is part of a series of pull requests to add a full IndexedDB implementation of the
EventCacheStore
(see #4617, #4996, #5090, #5138, #5226, #5274, #5343, #5384, #5406). This particular pull request focuses on providing implementations for theEvent
-related functions inEventCacheStore
.Changes
The changes include implementations of the following functions, as well as tests for each of them.
EventCacheStore::filter_duplicated_events
EventCacheStore::find_event
EventCacheStore::find_event_relations
EventCacheStore::save_event
I have also added a few other functions which support the implementation of the functions above.
IndexedEventRelationKey::set_related_event
IndexeddbEventCacheStoreTransaction::get_event_by_id
IndexeddbEventCacheStoreTransaction::get_events_by_relation
IndexeddbEventCacheStoreTransaction::get_events_by_related_event
Bug Fixes
There is also a small change to how
Update::PushItems
is handled. Namely, if a given item already exists in the database, it will update that item, rather than returning an error. The new behavior is consistent with the SQLite implementation ofEventCacheStore
(see here).This bug was surfaced by
matrix_sdk_base::event_cache::store::integration_tests::test_find_event_relations
.Future Work
EventCacheStore::try_take_leased_lock
functions without relying onMemoryStore
EventCacheStoreMedia
Signed-off-by: Michael Goldenberg m@mgoldenberg.net