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

feat(send queue): send attachments with the send queue #4195

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

bnjbvr
Copy link
Member

@bnjbvr bnjbvr commented Oct 30, 2024

This is the "draw the rest of the freaking howl" step of #1732. Will break into smaller PRs if it behaves as intended.

…dent requests

This makes it possible to have different kinds of *parent key*, to
update a dependent request. A dependent request waits for the parent key
to be set, before it can be acted upon; before, it could only be an
event id, because a dependent request would only wait for an event to be
sent. In a soon future, we're going to support uploading medias as
requests, and some subsequent requests will depend on this, but won't be
able to rely on an event id (since an upload doesn't return an
event/event id).

Since this changes the format of `DependentQueuedRequest`, which is
directly serialized into the state stores, I've also cleared the table,
to not have to migrate the data in there. Dependent requests are
supposed to be transient anyways, so it would be a bug if they were
transient.

Since a migration was needed anyways, I've also removed the `rename`
annotations (that supported a previous format) for the
`DependentQueuedRequestKind` enum.
…`, not a raw event

Changelog: The send queue will now store a serialized
 `QueuedRequestKind` instead of a raw event, which breaks the format.
 As a result, all send queues have been emptied.
Because the latest migration would clear events to-be-sent from the send
queue, the test now failed. It's been considered OK.
Notably, make it super clear what parameters are required to create the
attachment type, since the function doesn't consume the whole
`AttachmentConfig` for realz.
@bnjbvr bnjbvr changed the title Bnjbvr/refactor send queue storage feat(send queue): send attachments with the send queue Oct 30, 2024
Copy link

codecov bot commented Oct 30, 2024

Codecov Report

Attention: Patch coverage is 47.30290% with 127 lines in your changes missing coverage. Please review.

Project coverage is 84.58%. Comparing base (be88e0a) to head (bd6402b).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
crates/matrix-sdk/src/send_queue.rs 33.33% 114 Missing ⚠️
crates/matrix-sdk/src/room/mod.rs 76.92% 6 Missing ⚠️
crates/matrix-sdk/src/encryption/mod.rs 0.00% 4 Missing ⚠️
...rates/matrix-sdk-ui/src/timeline/controller/mod.rs 0.00% 2 Missing ⚠️
crates/matrix-sdk-base/src/store/send_queue.rs 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4195      +/-   ##
==========================================
- Coverage   84.90%   84.58%   -0.33%     
==========================================
  Files         271      271              
  Lines       29070    29203     +133     
==========================================
+ Hits        24681    24700      +19     
- Misses       4389     4503     +114     

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

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