-
Notifications
You must be signed in to change notification settings - Fork 362
IndexedDB: use implementations of EventCacheStore and MediaStore in client
#5946
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: use implementations of EventCacheStore and MediaStore in client
#5946
Conversation
CodSpeed Performance ReportMerging #5946 will not alter performanceComparing Summary
Footnotes
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5946 +/- ##
=======================================
Coverage 88.51% 88.51%
=======================================
Files 363 363
Lines 103590 103590
Branches 103590 103590
=======================================
+ Hits 91688 91690 +2
+ Misses 7538 7536 -2
Partials 4364 4364 ☔ View full report in Codecov by Sentry. |
Hywan
left a comment
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 for the patches!
I wonder why we would need a struct holding all the stores. We don't have that for SQLite nor in-memory stores. Why is it important here?
I was mostly just trying to stick to the pattern that was already established in I am happy to re-think this and, instead, expose functions that enable users of the crate to construct each store individually. However, there's one consideration to note about going that route. The original author initialized a single pub async fn open_stores_with_name(
name: &str,
passphrase: Option<&str>,
) -> Result<(IndexeddbStateStore, IndexeddbCryptoStore), OpenStoreError> {
// -- snip --
let crypto_store =
IndexeddbCryptoStore::open_with_store_cipher(name, state_store.store_cipher.clone())
.await?;
// -- snip --
}I'm not sure why this was done, but it requires access to In order to allow users of the crate to construct each store individually, we would have to do one of two things.
Let me know what you think, happy to go in any direction! And also happy to explain more if this isn't making sense. |
|
I prefer to stick with the original vision for the moment. We can still change in the future! Thank you for the explanations. |
Hywan
left a comment
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.
Good to me! Can you rebase your fixup commits, so that we can merge this nice PR please?
… name Signed-off-by: Michael Goldenberg <[email protected]>
Signed-off-by: Michael Goldenberg <[email protected]>
Signed-off-by: Michael Goldenberg <[email protected]>
Signed-off-by: Michael Goldenberg <[email protected]>
… serializers Signed-off-by: Michael Goldenberg <[email protected]>
…ation Signed-off-by: Michael Goldenberg <[email protected]>
…n isolation Signed-off-by: Michael Goldenberg <[email protected]>
Signed-off-by: Michael Goldenberg <[email protected]>
Signed-off-by: Michael Goldenberg <[email protected]>
Signed-off-by: Michael Goldenberg <[email protected]>
Signed-off-by: Michael Goldenberg <[email protected]>
Signed-off-by: Michael Goldenberg <[email protected]>
4d21c7f to
d36d2f8
Compare
Background
This is the final pull request in the series of pull requests to add a full IndexedDB implementation of the
EventCacheStoreandMediaStore(see #4617, #4996, #5090, #5138, #5226, #5274, #5343, #5384, #5406, #5414, #5497, #5506, #5540, #5574, #5603, #5676, #5682, #5749, #5795, #5933). This particular pull request adds the IndexedDB implementations ofEventCacheStoreandMediaStoreinto thematrix_sdk::Clientwhen it is configured to use IndexedDB as its data store.Changes
Expose
EventCacheStoreandMediaStorefunctions outsidematrix-sdk-indexeddbThis involved re-exporting some of the types internal to the crate - e.g.,
IndexeddbEventCacheStoreandIndexeddbMediaStore.Additionally, a composite type was added to hold all stores in a single structure - i.e.,
IndexeddbStores. This structure is also equipped with a set of functions for opening all the stores with a single function call.Refactor feature flags
There were some issues with enabling individual feature flags - e.g., enabling
event-cache-storeormedia-storewithoute2e-encryptionfailed to compile. These issues surfaced once trying to use them viamatrix-sdk.The flags have been refactored so that each of the different stores may be used independent of and in combination with the others.
Use implementations of
EventCacheStoreandMediaStoreinmatrix-sdk::Clientmatrix_sdk::client::builder::build_indexeddb_store_confighas been updated so that it initializes theStoreConfigwith IndexedDB implementations of all of the stores. And, of course, it includes the crypto store whene2e-encryptionis enabled.Signed-off-by: Michael Goldenberg [email protected]