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

task(send queue): demote some assertions back to logged errors #4269

Merged
merged 1 commit into from
Nov 15, 2024

Conversation

bnjbvr
Copy link
Member

@bnjbvr bnjbvr commented Nov 14, 2024

Better safe than panicky. I don't want a bad surprise when coming back from my weekend.

@bnjbvr bnjbvr requested a review from a team as a code owner November 14, 2024 16:16
@bnjbvr bnjbvr requested review from andybalaam and removed request for a team November 14, 2024 16:16
@bnjbvr bnjbvr enabled auto-merge (rebase) November 14, 2024 16:16
Copy link

codecov bot commented Nov 14, 2024

Codecov Report

Attention: Patch coverage is 63.63636% with 4 lines in your changes missing coverage. Please review.

Project coverage is 85.03%. Comparing base (cefd5a2) to head (cb87116).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
crates/matrix-sdk/src/send_queue.rs 63.63% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4269      +/-   ##
==========================================
+ Coverage   85.00%   85.03%   +0.02%     
==========================================
  Files         274      274              
  Lines       29945    29952       +7     
==========================================
+ Hits        25456    25470      +14     
+ Misses       4489     4482       -7     

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

);

let prev_txn = was_being_sent.as_ref().map(|info| info.transaction_id.as_ref());
if prev_txn != Some(transaction_id) {
Copy link
Contributor

Choose a reason for hiding this comment

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

The assert would have aborted execution here, while we now continue on, is that fine? Don't we want to perhaps return early?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it would be a sign that the system is in a weird state, but the transaction_id passed as a parameter is the important value that is correct above all, so the current code is fine.

@bnjbvr bnjbvr merged commit 232391c into main Nov 15, 2024
40 checks passed
@bnjbvr bnjbvr deleted the bnjbvr/lower-assertions-to-errors branch November 15, 2024 09:35
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