Skip to content

IndexedDB: Make IndexeddbSerializer shareable between modules in matrix-sdk-indexeddb #4996

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

Merged
merged 6 commits into from
May 5, 2025

Conversation

mgoldenberg
Copy link
Contributor

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 to event_cache_store::indexeddb_serializer with minor modifications (see here). In preparation for integrating this work, I have made the following changes.

  1. Moved the IndexeddbSerializer to the top-level so it may be shared between modules in the crate.
  2. Created a new error type, IndexeddbSerializerError to be used with IndexeddbSerializer.
    1. Previously, it was using 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 by IndexeddbEventCacheStore.


  • Public API changes documented in changelogs (optional)

Signed-off-by: Michael Goldenberg [email protected]

@mgoldenberg mgoldenberg requested a review from a team as a code owner May 2, 2025 13:07
@mgoldenberg mgoldenberg requested review from stefanceriu and removed request for a team May 2, 2025 13:07
@mgoldenberg
Copy link
Contributor Author

Apologies about the failures, I am fixing them now!

@mgoldenberg mgoldenberg marked this pull request as draft May 2, 2025 13:20
Copy link

codecov bot commented May 2, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.88%. Comparing base (284db61) to head (72da680).
Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4996      +/-   ##
==========================================
+ Coverage   85.86%   85.88%   +0.02%     
==========================================
  Files         325      325              
  Lines       35851    35851              
==========================================
+ Hits        30783    30791       +8     
+ Misses       5068     5060       -8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mgoldenberg mgoldenberg force-pushed the shared-indexeddb-serializer branch from 1104506 to 72da680 Compare May 2, 2025 14:21
@mgoldenberg mgoldenberg marked this pull request as ready for review May 2, 2025 14:35
Copy link
Member

@Hywan Hywan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your patches. They are making sense to me. Thanks for doing small patches, I appreciate.

@Hywan Hywan merged commit 8fd122c into matrix-org:main May 5, 2025
80 checks passed
@mgoldenberg mgoldenberg deleted the shared-indexeddb-serializer branch May 7, 2025 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants