IndexedDB: initialize StoreCipher in encrypted store tests
#5933
+36
−32
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 is part of a 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). This particular pull request fixes a number of bugs related to encrypted stores and their tests.The primary issue is that the encrypted tests were being run without a
StoreCipherfor both theEventCacheStoreand theMediaStore. Furthermore, once theStoreCipheris initialized for these tests, some of theEventCacheStoretests were failing.Changes
Initialize
StoreCipherin encrypted testsThis is pretty simple, just add a
StoreCiphertoevent_cache_store::tests::encrypted::get_event_cache_storeandmedia_store::tests::encrypted::get_media_store.Fix failing tests in
EventCacheStoreA number of tests began to fail when introducing encryption to the
EventCacheStore.event_cache_store_integration_tests::test_get_room_eventsevent_cache_store_integration_tests::test_get_room_events_filteredevent_cache_store_integration_tests::test_remove_roomThese tests failed because the constants representing the uppermost and lowermost possible bounds of an
EventIdwere being encrypted when constructing a query for all events in a room. Once encrypted, these constants no longer represented the uppermost and lowermost possible bounds of anEventId.The solution is to not encrypt these constant values, as they lose their purpose once encrypted.
Future Work
EventCacheStoreandMediaStoreoutside of thematrix-sdk-indexeddbSigned-off-by: Michael Goldenberg [email protected]