-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[wip] snooze rpc #23305
base: master
Are you sure you want to change the base?
[wip] snooze rpc #23305
Conversation
go/install/install_default.go
Outdated
@@ -32,3 +32,8 @@ func StartUpdateIfNeeded(context.Context, logger.Logger) error { | |||
func GetNeedUpdate() (bool, error) { | |||
return false, nil | |||
} | |||
|
|||
// SnoozeUpdate will snooze the new update (if there is one) for 24 hrs. | |||
func SnoozeUpdate() error { |
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.
for linux, it was discussed (cc @heronhaye ?) we might want to be able to snooze indefinitely
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 believe (jacob knows more about this) that this snoozing is done serverside. Should probably be handled clientside for linux. Could just set it in config.json maybe. Ideally there would be an undo button in the GUI as well but not a priority.
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.
Couple of things here.
-
Snoozing is done on the server for
macOS
andWindows
clients since they haveupdate
binaries bundled. -
Linux client have never snoozed historically because they don't have
installID
s. So calling directly to the API server here implicitly depends on aninstallID
. We wouldn't want to do that. -
It's correct to call into the updater on
macOS
andWindows
since it will handle/manageinstallID
s. -
@heronhaye is correct that on Linux this 'snoozing' can only happen client side since we can't depend on the
install
orupdate
binaries being present. -
service/config.go
would want to perform a platform check (for linux), and instead of calling intoinstall
we would call something else that would write toconfig.json
with the end snooze timestamp (epoch?). Subsequent checks for updates on Linux (handled in PICNIC-664) should read fromconfig.json
to see if we are before the snooze timestamp. Checking for an update after the snooze timestamp should clear the snooze setting automatically. This discussion thread can be carried into PICNIC-664. -
'Undo' needs to go through design. Instead we can add a button to the GUI under settings that says 'Check for update'.
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.
Sounds fine. The install package already does the platform check so you can just put the config write here.
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.
great
if err != nil { | ||
return err | ||
} | ||
exec.Command(updaterPath, "snooze") |
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.
blocked on keybase/go-updater#195
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.
Linux
0076214
to
b2520d4
Compare
@@ -392,6 +392,8 @@ func (m MetaContext) switchUserNewConfig(u keybase1.UID, n NormalizedUsername, s | |||
return err | |||
} | |||
} | |||
// TODO: do i need to do anything particular for snooze_updates when user |
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.
do i need to do anything particular for snooze_updates when user switching?
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 believe that updater settings is per-install and not per-user but @thebearjew should confirm
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.
Actually don't know the answer to this off the top of my head. I'll look into it.
i added a "snooze update" RPC
on linux, this command will snooze all updates forever (it sets the
snooze_updates
boolean inconfig.json
).on darwin/windows, it will snooze the most recent update (if it exists) for 24 hrs.
i also added a CLI command (
keybase update snooze
)BLOCKERS:
need to rebase on https://github.com/keybase/client/pull/21591/files
blocked on keybase/go-updater#195