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

timeline: only use the send queue mechanism to send reactions #3865

Merged
merged 5 commits into from
Aug 22, 2024

Conversation

bnjbvr
Copy link
Member

@bnjbvr bnjbvr commented Aug 20, 2024

Independently of #3749, we can, as of today, start using the send queue only to send reactions, instead of having the logic of sending reactions in the timeline itself

There was a mechanism to queue adding/removing a reaction, with the possibility to get observable updates for each add/remove that occurred. In some contexts, if you quickly tapped a reaction button on ElementX apps, you could observe it: the reaction would be added, then removed, then added back, etc. until it stabilized.

I don't see the user value for this: if I quickly tap the reaction button, I'd expect the sending of the reaction to be aborted, if it can, instead of delayed into a redaction event that's subsequently sent. The sending queue allows doing this for free, so making use of that.

I've also removed tests which value was also unclear or suspect.

Copy link

codecov bot commented Aug 20, 2024

Codecov Report

Attention: Patch coverage is 82.70677% with 23 lines in your changes missing coverage. Please review.

Project coverage is 84.10%. Comparing base (c04dd18) to head (0723d4c).
Report is 5 commits behind head on main.

Files Patch % Lines
crates/matrix-sdk-ui/src/timeline/inner/mod.rs 74.71% 22 Missing ⚠️
crates/matrix-sdk-ui/src/timeline/util.rs 85.71% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3865      +/-   ##
==========================================
- Coverage   84.11%   84.10%   -0.02%     
==========================================
  Files         266      266              
  Lines       27787    27724      -63     
==========================================
- Hits        23372    23316      -56     
+ Misses       4415     4408       -7     

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

@bnjbvr bnjbvr force-pushed the bnjbvr/send-q-for-timeline-reactions branch 2 times, most recently from 9128e57 to b21cf41 Compare August 21, 2024 15:22
@bnjbvr bnjbvr marked this pull request as ready for review August 21, 2024 15:23
@bnjbvr bnjbvr requested a review from a team as a code owner August 21, 2024 15:23
@bnjbvr bnjbvr requested review from andybalaam and removed request for a team August 21, 2024 15:23
@bnjbvr bnjbvr force-pushed the bnjbvr/send-q-for-timeline-reactions branch from b21cf41 to 2908abe Compare August 21, 2024 15:24
@bnjbvr bnjbvr changed the title timeline: only use the send queue to send reactions, and nothing else timeline: only use the send queue mechanism to send reactions Aug 21, 2024
@Hywan Hywan requested review from Hywan and removed request for andybalaam August 21, 2024 15:43
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.

I like the way it goes, and it's clearly an improvement. Less code, more re-used code, well done!

I wonder if the patch could be split into multiple smaller ones though, it's not easy to review, but generally the changes look good! I'm confident with the tests.

@bnjbvr bnjbvr force-pushed the bnjbvr/send-q-for-timeline-reactions branch from 2908abe to f59388e Compare August 22, 2024 15:16
@bnjbvr bnjbvr enabled auto-merge (rebase) August 22, 2024 15:16
@bnjbvr bnjbvr force-pushed the bnjbvr/send-q-for-timeline-reactions branch from f59388e to 0723d4c Compare August 22, 2024 15:28
@bnjbvr bnjbvr merged commit 2db031c into main Aug 22, 2024
40 checks passed
@bnjbvr bnjbvr deleted the bnjbvr/send-q-for-timeline-reactions branch August 22, 2024 15:46
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