-
Notifications
You must be signed in to change notification settings - Fork 25
fix: schedule commit pending proposals - WPB-22062 #3963
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
base: release/cycle-4.12
Are you sure you want to change the base?
Conversation
acec2b8 to
4780bab
Compare
| ).post() | ||
| } | ||
|
|
||
| syncContext.perform { [weak self] in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed as we don't need to repair out of sync conv after initial sync, it will be done by MLSRepairGroup during incrementalSync before iterating over the live stream
| WireLogger.mls.warn("`qualifiedClientID` is missing for selfClient") | ||
| } | ||
|
|
||
| if !isRecovering, mlsFeature.isEnabled { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is now replaced by any item generated by the CommitPendingProposalGenerator
Test Results 1 files 131 suites 16s ⏱️ For more details on these failures, see this check. Results for commit 21bff1e. ♻️ This comment has been updated with latest results. |
7d1e8a8 to
806c644
Compare
806c644 to
36c5e90
Compare
| // otherwise assume that things will sort themselves out through conversation reset. | ||
| let feature = await featureRepository.fetchAllowedGlobalOperations() | ||
| if feature.status == .disabled || feature.config.mlsConversationReset == false { | ||
| // check if this can be removed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: why do you suspect it can be removed?
| } | ||
|
|
||
| public func stop() { | ||
| fetchedResultsController.delegate = nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: should we tear down the FRC instead like in the other generator?
|
|
||
| let timeIntervalSinceNow = timestamp.timeIntervalSinceNow | ||
| if timeIntervalSinceNow > 0 { | ||
| try await Task.sleep(for: .seconds(timeIntervalSinceNow)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: this will block the sync agent right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WorkAgent you mean?
|
|
||
| // Ensure live does NOT start on this state | ||
| live.start_MockMethod = { | ||
| Issue.record("Live generator should not start during incrementalSyncing(.createPushChannel)") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: what is Issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's a type from SwiftTesting you can basically create your error
Issue
Commit pending proposals should never be executed while performing the incrementalSync. Right now, it's scheduled
via a simple Task.
This PR introduces a generator that will create workItems to commitPendingProposals at the end of incrementalSync and while live sync (push channel open) is running.
CommitPendingProsalsGenerator checks conversations with commitPendingProposalDates and generates CommitPendingProposalItem. This only happens after incrementalSync is done in mainApp.
Then the WorkAgent will run the CommitPendingProposalItem.
Testing
Pending proposals are generated when user leaves a conversation, client is deleted.
Try reproduce these cases and check logs for work-item being generated
Checklist
[WPB-XXX].UI accessibility checklist
If your PR includes UI changes, please utilize this checklist: