-
Notifications
You must be signed in to change notification settings - Fork 6
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: allow returning values on commit retry [WPB-3694] #2609
refactor: allow returning values on commit retry [WPB-3694] #2609
Conversation
This should no behaviour changes at all, but will allow customisation of some MLS pipelines in the near future. This refactors the `retryOnCommitFailure` function (renamed to `produceAndSendCommitWithRetryAndResult`), so it allows returning a produced value if the commit succeeds. The function now takes the responsibility of sending the generated commit, instead of relying on the callers to do so. It also conveniently provides a MLSClient for the callers, as this is the way to obtain a `CommitBundle`.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release/candidate #2609 +/- ##
====================================================
Coverage ? 58.36%
Complexity ? 7
====================================================
Files ? 1177
Lines ? 46064
Branches ? 4365
====================================================
Hits ? 26887
Misses ? 17220
Partials ? 1957
Continue to review full report in Codecov by Sentry.
|
Datadog ReportBranch report: ✅ 0 Failed, 2825 Passed, 123 Skipped, 9m 12.04s Wall Time |
This should cause no changes in behaviour at all, but will allow customisation of some MLS pipelines in the near future. This refactors the `retryOnCommitFailure` function (renamed to `produceAndSendCommitWithRetryAndResult`), so it allows returning a produced value if the commit succeeds. The function now takes the responsibility of sending the generated commit, instead of relying on the callers to do so. It also conveniently provides a MLSClient for the callers, as this is the way to obtain a `CommitBundle`. (cherry picked from commit 390b880)
PR Submission Checklist for internal contributors
The PR Title
SQPIT-764
The PR Description
What's new in this PR?
Issues
When producing commits inside
MLSConversationRepository
and callingretryOnCommitFailure
, there's no easy way to get values linked to the produced commit.For example, in the next PR I want to enable creating MLS groups with partial success, and return the non-added users.
But inside
establishMLSGroup
, I can't keep track of the success the operation had during the retries.Cause
The
retryOnCommitFailure
only supports returningUnit
on success.Solutions
Note
This PR should have no behaviour changes at all, but will allow customisation of some MLS pipelines in the near future. For the tickets: [WPB-3694][WPB-6646][WPB-6643]
Refactor the
retryOnCommitFailure
function (renamed toproduceAndSendCommitWithRetryAndResult
), so it allows returning a produced value if the commit succeeds.To reduce code change in this PR, also created a
produceAndSendCommitWithRetry
forUnit
results.The function now takes the responsibility of sending the generated commit, instead of relying on the callers to do so. It also conveniently provides a MLSClient scope for the callers, as this is the way to obtain a
CommitBundle
.Testing
N/A
MLSConversationRepository
is already covered with tests regarding the retry pipeline. Kudos to @typfelPR Post Merge Checklist for internal contributors
References
feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764
.