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): maintain ordering of sending #4259

Merged
merged 2 commits into from
Nov 14, 2024
Merged

Conversation

bnjbvr
Copy link
Member

@bnjbvr bnjbvr commented Nov 13, 2024

Prior to this patch, the send queue would not maintain the ordering of
sending a media then a text, because it would push back a dependent
request graduating into a queued request.

The solution implemented here consists in adding a new priority column
to the send queue, defaulting to 0 for existing events, and use higher
priorities for the media uploads, so they're considered before other
requests.

A high priority is also used for aggregation events that are sent late,
so they're sent as soon as possible, before other subsequent events.

Let's say it's part of #4201.

@bnjbvr bnjbvr requested a review from a team as a code owner November 13, 2024 13:28
@bnjbvr bnjbvr requested review from andybalaam and removed request for a team November 13, 2024 13:28
@bnjbvr bnjbvr force-pushed the bnjbvr/send-queue-ordering branch from 21248ab to cba7224 Compare November 13, 2024 13:38
Copy link

codecov bot commented Nov 13, 2024

Codecov Report

Attention: Patch coverage is 98.36066% with 1 line in your changes missing coverage. Please review.

Project coverage is 84.94%. Comparing base (d614878) to head (84af9e2).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
crates/matrix-sdk-base/src/store/traits.rs 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4259      +/-   ##
==========================================
- Coverage   84.94%   84.94%   -0.01%     
==========================================
  Files         274      274              
  Lines       29805    29851      +46     
==========================================
+ Hits        25319    25357      +38     
- Misses       4486     4494       +8     

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

Copy link
Member

@andybalaam andybalaam left a comment

Choose a reason for hiding this comment

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

This looks very nice. Some questions, nothing blocking.

Prior to this patch, the send queue would not maintain the ordering of
sending a media *then* a text, because it would push back a dependent
request graduating into a queued request.

The solution implemented here consists in adding a new priority column
to the send queue, defaulting to 0 for existing events, and use higher
priorities for the media uploads, so they're considered before other
requests.

A high priority is also used for aggregation events that are sent late,
so they're sent as soon as possible, before other subsequent events.
@bnjbvr bnjbvr force-pushed the bnjbvr/send-queue-ordering branch from cba7224 to 84af9e2 Compare November 14, 2024 10:45
@bnjbvr bnjbvr enabled auto-merge (rebase) November 14, 2024 10:57
@bnjbvr bnjbvr merged commit c02d8ce into main Nov 14, 2024
40 checks passed
@bnjbvr bnjbvr deleted the bnjbvr/send-queue-ordering branch November 14, 2024 11:00
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