IndexedDB: Make IndexeddbSerializer
shareable between modules in matrix-sdk-indexeddb
#4996
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background
This pull request has a high-level focus on integrating work on an IndexedDB implementation of the
EventCacheStore
(see #4617). Those changes were rather large and sprawling and included code duplication, so this is part of a series of pull requests which will break that work into smaller, more manageable changes.Changes
This change is focused on de-duplicating code. In #4617,
crypto_store::indexeddb_serializer
was copy-and-pasted toevent_cache_store::indexeddb_serializer
with minor modifications (see here). In preparation for integrating this work, I have made the following changes.IndexeddbSerializer
to the top-level so it may be shared between modules in the crate.IndexeddbSerializerError
to be used withIndexeddbSerializer
.IndexeddbCryptoStoreError
, which was too specific for a generalized use-case.Additionally, I have prioritized making changes in such a way that does not change the public API of the crate. This means some of the changes weren't as sensible as they could have been, but it helped to keep the pull request small.
Future Work
The next pull request in this series will make additions to the
IndexeddbSerializer
- there are two functions which #4617 added to its copy of the serializer and which are used byIndexeddbEventCacheStore
.Signed-off-by: Michael Goldenberg [email protected]