Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Report action to API #40

Merged
merged 7 commits into from
May 2, 2016
Merged

Report action to API #40

merged 7 commits into from
May 2, 2016

Conversation

gabriel
Copy link
Contributor

@gabriel gabriel commented Apr 27, 2016

The gocyclo score for updater.Update() got too high so had to reduce it a little.

@keybase/updater-hackers

The gocyclo score for updater.Update() got too high so had to reduce it a little
@gabriel
Copy link
Contributor Author

gabriel commented Apr 27, 2016

@keybase/updater-hackers bump

# The first commit's message is:

Report action to API

The gocyclo score for updater.Update() got too high so had to reduce it a little

# This is the 2nd commit message:

Add tests
case UpdateActionApply:
ctx.ReportAction(UpdateActionApply, options)
case UpdateActionAuto:
ctx.ReportAction(UpdateActionAuto, options)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this when they chose to apply the update, and also have clicked the "make next update auto" button?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

auto is if the update was applied automatically without user prompt...

so the first time the action will be apply, and if they checked automatic, then next time it would be auto

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. The way it's currently implemented, if you send apply then the auto bit is set to false, and if you send auto, the auto bit is set to true:

https://github.com/keybase/keybase/pull/647/files#diff-09c19ea087354ad87b44929d4a676ff1R224

Copy link
Contributor Author

@gabriel gabriel May 2, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it important to distinguish between... this update was applied without user being prompted... in which case my reporting is correct... if the goal is to report the "auto" setting then we need to change this request to not mix an action with state?

So params would be?

action: "apply", "snooze", "cancel", "auto"
auto_update: 1/0

If apply is chosen and user doesn't enable auto: action=apply&auto_update=0
If apply is chosen and user turns on auto: action=apply&auto_update=1
If there was no prompt: action=auto&auto_update=1

If we ever see auto with auto_apply=0 then that would indicate a problem.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with this change, though I would have predicted that you wouldn't like a 2x2 of bools in which one quadrant is undefined behavior :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, changed the pseudocode and confluence doc to match. BTW, I never implemented cancel here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I remove reporting of cancel? It's probably not useful. Only happens in case of prompt timeout.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can report it and the server can ignore it if it wants to?

@jzila
Copy link

jzila commented Apr 29, 2016

A few nits. Looks good otherwise.

@gabriel
Copy link
Contributor Author

gabriel commented May 2, 2016

Gonna add async reporting and auto_update in separate PRs.

@gabriel gabriel merged commit 271b324 into reporterror May 2, 2016
gabriel added a commit that referenced this pull request May 2, 2016
@gabriel gabriel deleted the reportaction branch May 2, 2016 19:59
zanderz pushed a commit that referenced this pull request Jun 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants