-
Notifications
You must be signed in to change notification settings - Fork 11
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
Address updater feedback #3690
Address updater feedback #3690
Conversation
3aee5b7
to
120d1f5
Compare
self.init(status: updateController.updateProgress.toStatus, | ||
currentVersion: currentVersion, | ||
lastUpdate: lastUpdate) | ||
lastUpdate: lastUpdate, | ||
automaticUpdate: updateController.areAutomaticUpdatesEnabled) |
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 happens when Release Notes screen is displayed but the appcast hasn't been loaded yet. We get both incorrect status (updateReady), wrong button text (Restart to Update / Update DuckDuckGo), and the button doesn't even work.
For more details: https://app.asana.com/0/0/1209058536716904/f
@@ -198,7 +199,7 @@ private extension UpdateCycleProgress { | |||
case .downloadDidStart, .downloading: return .updateDownloading | |||
case .extractionDidStart, .extracting, .readyToInstallAndRelaunch, .installationDidStart, .installing: return .updatePreparing | |||
case .updaterError: return .updateError | |||
case .updateCycleNotStarted, .updateCycleDone: return .updateReady | |||
case .updateCycleNotStarted, .updateCycleDone: return .loaded |
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.
These should've been defaulted to loaded
as we only want updateReady
if we truly have a pending update.
guard let updateController = Application.appDelegate.updateController else { | ||
return | ||
} |
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.
Just to satisfy the compiler as AppDelegate.updateController is implicitly unwrapped already.
func updater(_ updater: SPUUpdater, willInstallUpdateOnQuit item: SUAppcastItem, immediateInstallationBlock immediateInstallHandler: @escaping () -> Void) -> Bool { | ||
Logger.updates.log("Updater will install update on quit: \(item.displayVersionString, privacy: .public)(\(item.versionString, privacy: .public))") | ||
userDriver?.configureResumeBlock(immediateInstallHandler) | ||
return true |
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 delegate method isn't called in my testing scenarios, but when it does in prod, let's make sure we use the immediateInstallHandler
to set up our resume block for Install Now.
reply(.dismiss) | ||
} | ||
|
||
onSkipping = { reply(.skip) } | ||
onDismiss = { reply(.dismiss) } |
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.
Skip can ignore the update, which we don't want.
if !applicationTerminated { | ||
Logger.updates.log("Updater re-sent a quit event") | ||
retryTerminatingApplication() | ||
} |
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.
Not strictly necessary, but there seems to be no harm in doing this.
case .downloadDidStart, .downloading: return .updateDownloading | ||
case .extractionDidStart, .extracting, .readyToInstallAndRelaunch, .installationDidStart, .installing: return .updatePreparing | ||
case .updaterError: return .updateError | ||
case .updateCycleNotStarted, .updateCycleDone: return .updateReady | ||
case .updateCycleDone: return .loaded |
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.
updateReady
should never be returned here unless we're truly ready to proceed with an update.
77d244a
to
4fed45f
Compare
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.
@quanganhdo I went through the different scenarios on: https://app.asana.com/0/1199230911884351/1208882660080993/f, and everything work as expected. Let’s merge this into the release branch 👍🏼
Task/Issue URL: https://app.asana.com/0/1201048563534612/1209026627874986/f
Tech Design URL:
CC:
Description:
Addresses some updater feedback:
Also adds more logging to help track down the edge cases (non-producible on my machine, but some internal users kept running into them)
Optional E2E tests:
Check this to run the Personal Information Removal end to end tests. If updating CCF, or any PIR related code, tick this.
Steps to test this PR:
log show --info --predicate 'subsystem == "Updates"' --style compact --last 24h > ~/Downloads/updater.log
Definition of Done:
Internal references:
Pull Request Review Checklist
Software Engineering Expectations
Technical Design Template
Pull Request Documentation