Skip to content
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

refactor(send queue): refactor in preparation for media local echoes #4176

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

bnjbvr
Copy link
Member

@bnjbvr bnjbvr commented Oct 28, 2024

This refactors the send queue so that it can apply sending more abstract requests, instead of only sending plain events. This will generalize to media uploads soon, but in the future might also generalize to sending redactions, etc. So we now queue requests, update requests, and so on; which leads to some fun renaming in a massive patch, but no changes in functionality. Those would come in subsequent pull requests.

Indexeddb has a database format change, that is gently handled the same way we did for is_wedged vs wedged errors, that is: the migration applies at the reading boundary (we can't use the #[serde(untagged)] enum trick because we're storing a raw JSON value, and this is known to be buggy in serde). Sqlite hasn't been modified yet.

Part of #1732.

@bnjbvr bnjbvr requested a review from a team as a code owner October 28, 2024 14:54
@bnjbvr bnjbvr requested review from stefanceriu and removed request for a team October 28, 2024 14:54
…d_queue module

No changes in functionality, only code motion.
In a next commit, the `QueuedEvent` will be renamed to `QueuedRequest`.
This specifies which kind of request we want to send with the send
queue; for now, it can only be an event.
@bnjbvr bnjbvr force-pushed the bnjbvr/refactor-queued-events branch from 051768a to f0b41e3 Compare October 28, 2024 14:54
Copy link

codecov bot commented Oct 28, 2024

Codecov Report

Attention: Patch coverage is 95.80838% with 7 lines in your changes missing coverage. Please review.

Project coverage is 84.77%. Comparing base (40f4fc1) to head (f0b41e3).
Report is 16 commits behind head on main.

Files with missing lines Patch % Lines
crates/matrix-sdk/src/send_queue.rs 91.86% 7 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4176   +/-   ##
=======================================
  Coverage   84.77%   84.77%           
=======================================
  Files         269      270    +1     
  Lines       28963    28966    +3     
=======================================
+ Hits        24552    24557    +5     
+ Misses       4411     4409    -2     

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

@bnjbvr
Copy link
Member Author

bnjbvr commented Oct 28, 2024

Wait, a rename of serialized JSON field names is a breaking change, since the field name is encoded next to the value, IIRC. Will have to do the sqlite migration here too \o/

@bnjbvr bnjbvr marked this pull request as draft October 28, 2024 15:52
@bnjbvr bnjbvr removed the request for review from stefanceriu October 28, 2024 15:52
@bnjbvr
Copy link
Member Author

bnjbvr commented Oct 28, 2024

Wait, a rename of serialized JSON field names is a breaking change, since the field name is encoded next to the value, IIRC. Will have to do the sqlite migration here too \o/

nope

Changelog: Renamed all the send-queue related "events" to "requests", so
  as to generalize usage of the send queue to not-events (e.g. medias,
  redactions, etc.).
@bnjbvr bnjbvr force-pushed the bnjbvr/refactor-queued-events branch from f0b41e3 to acf9081 Compare October 28, 2024 17:36
@bnjbvr bnjbvr marked this pull request as ready for review October 28, 2024 17:36
@bnjbvr bnjbvr requested review from a team and andybalaam and removed request for a team October 28, 2024 17:39
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.

1 participant