-
Notifications
You must be signed in to change notification settings - Fork 330
IndexedDB: implement EventCacheStore::try_take_leased_lock
#5506
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
IndexedDB: implement EventCacheStore::try_take_leased_lock
#5506
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5506 +/- ##
=======================================
Coverage 88.57% 88.57%
=======================================
Files 340 340
Lines 93665 93665
Branches 93665 93665
=======================================
+ Hits 82960 82964 +4
+ Misses 6575 6569 -6
- Partials 4130 4132 +2 ☔ View full report in Codecov by Sentry. |
CodSpeed Performance ReportMerging #5506 will not alter performanceComparing Summary
|
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.
Looks great! Thanks! A few tiny feedback. Apart from that, great job.
crates/matrix-sdk-base/src/event_cache/store/integration_tests.rs
Outdated
Show resolved
Hide resolved
Good! Can you rebase your history please? Then we can merge the PR. |
…ache Signed-off-by: Michael Goldenberg <[email protected]>
… event cache Signed-off-by: Michael Goldenberg <[email protected]>
…nt cache Signed-off-by: Michael Goldenberg <[email protected]>
…y_take_leased_lock Signed-off-by: Michael Goldenberg <[email protected]>
… with wasm targets Signed-off-by: Michael Goldenberg <[email protected]>
Signed-off-by: Michael Goldenberg <[email protected]>
e121da6
to
c4431cc
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, #5414, #5497). This particular pull request adds an IndexedDB-backed implementation ofEventCacheStore::try_take_leased_lock
.Changes
The following types have been added for representing and indexing leased locks.
Lease
- the primary type for representing a leased lock.IndexedLease
- an indexed version ofLease
.IndexedLeaseIdKey
- the primary key of anIndexedLease
.To store the types above, an object store (
v1::keys::LEASES
) gets created when upgrading the database to version1
with primary keyid
.Additionally, the following transaction functions are added for conveniently working with leases.
IndexeddbEventCacheStoreTransaction::get_lease_by_id
IndexeddbEventCacheStoreTransaction::put_lease
Tests
matrix_sdk_base::event_cache_store_integration_tests_time
previously usedtokio::time::sleep
which is not supported onwasm
targets.(Link to text here).
I have modified this macro so that when running on
wasm
targets with an unknown operating system, we use a compatible crate, i.e.,gloo_timers
. This way, these tests can be run against thematrix-sdk-indexeddb
crate.Future Work
LinkedChunkId
(see here).EventCacheStoreMedia
Signed-off-by: Michael Goldenberg [email protected]