-
Notifications
You must be signed in to change notification settings - Fork 21
Conversation
What is |
updater.go
Outdated
@@ -129,6 +129,8 @@ func (u *Updater) update(ctx Context, options UpdateOptions) (*Update, error) { | |||
return update, promptErr(fmt.Errorf("Unknown prompt error")) | |||
case UpdateActionContinue: | |||
// Continue | |||
case UpdateActionUIBusy: | |||
// Continue (no need to report this to the server) |
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.
I think the point of finding out UIBusy
is to not do the update yet. So this should be more like case UpdateActionError
, right?
updater.go
Outdated
} | ||
if err != nil { | ||
return UpdateActionError, err | ||
} |
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.
Swap isActive
and err
checks.
(I edited this comment, sorry for the confusion)
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.
Now that you've changed checkUserActive
to actually return errors instead of just returning err=nil
all the time. If that thing fails the proper response is probably to go ahead and update. A faulty gui writing bogus app-state files shouldn't block upgrades forever.
What about something like this where we just ignore errors from checkUserActive
?
isActive, err := u.checkUserActive(ctx)
if err == nil && isActive {
return UpdateActionUIBusy, nil
}
u.guiBusyCount == 0
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.
ah of course, sorry. I added to the test for this case.
autoOverride is kind of a Windows leftover from when we attempted to detect whether the update contained new drivers, in which case silent update had to be skipped. |
@@ -15,6 +15,8 @@ const ( | |||
CancelError ErrorType = "cancel" | |||
// ConfigError is for errors reading/saving config | |||
ConfigError ErrorType = "config" | |||
// ConfigError is for when the GUI is active | |||
GUIBusyError ErrorType = "guiBusy" |
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.
Now this dude's unused
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 used in IsGuiBusy() to test for this case in report()
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.
oh yeah my bad
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.
Looks good!
No description provided.