IndexedDB: initialize StoreCipher in encrypted store tests#5933
Merged
Hywan merged 3 commits intoDec 9, 2025
Merged
Conversation
… cache and media store Note that the encrypted tests were actually being run unencrypted. Introducing a store cipher causes them to run encrypted, and furthermore, reveals some bugs which are only visible when running an encrypted event cache store. Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
In the implementation of EventCacheStore, there are a number of places where the upper and lower bounds of an EventId are constructed. It is important to bypass hashing and encryption when constructing these bounds, otherwise the values will be modified and will no longer represent the bounds. Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
CodSpeed Performance ReportMerging #5933 will not alter performanceComparing Summary
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5933 +/- ##
==========================================
- Coverage 88.50% 88.49% -0.01%
==========================================
Files 362 362
Lines 103291 103291
Branches 103291 103291
==========================================
- Hits 91413 91405 -8
- Misses 7535 7544 +9
+ Partials 4343 4342 -1 ☔ View full report in Codecov by Sentry. |
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 m@mgoldenberg.net