fix(sync): auth and health UX improvements

Problem: Failed token exchange left credential files on disk, trapping
users in a broken auth loop with no way back to setup. The `auth`
prompt used raw backend names and a terse prompt string. The `health`
action appeared in `:Pending gcal health` tab completion but silently
no-oped outside `:checkhealth`. gcal health omitted the token check
that gtasks had.

Solution: `_exchange_code` now calls `_wipe()` on both failure paths,
clearing the token and credentials files so the next `:Pending auth`
routes back through `setup()`. Prompt uses full service names and
"Authenticate with:". `health` is filtered from sync subcommand
completion and dispatch — its home is `:checkhealth pending`. gcal
health now checks for tokens.
This commit is contained in:
Barrett Ruth 2026-03-05 23:15:43 -05:00
parent 6e381c0d5f
commit fc58e22bfa
4 changed files with 19 additions and 5 deletions

View file

@ -216,7 +216,7 @@ end, {
end
local actions = {}
for k, v in pairs(mod) do
if type(v) == 'function' and k:sub(1, 1) ~= '_' then
if type(v) == 'function' and k:sub(1, 1) ~= '_' and k ~= 'health' then
table.insert(actions, k)
end
end