Uh oh!
There was an error while loading. Please reload this page.
fix(cli): delete guard fails fast on 426; keep-data save failure marks offboard degraded - #169
Merged
Merged
Conversation
…s offboard degraded Two more Cursor Bugbot findings on the develop->main PR (#164), same "never-lie / fail-fast" class as the prior rounds: - High: under --keep-data, if cfg.Save() fails after clearing the pointer in memory, the on-disk config still names the revoked client AND the closing line could still read as a clean offboard. Mark the offboard degraded on that Save failure (honest closing) and point the user at `tracebloc logout` / manual removal. - Medium: the pre-offboard online guard treated ANY lookupClientStatus error — including *api.UpgradeRequiredError (426, CLI too old) — as a warn-and-continue. A 426 won't recover by proceeding (the whole offboard hits the same backend), so fail fast with the upgrade message, matching runClientStatus. Other errors (5xx/429/network) stay transient. Test added: a 426 during the guard fails fast with the upgrade message and runs neither revoke nor any teardown step. go build/vet/test green (11 pkgs). Rolls up under the §7.10 offboarding work (Bugbot follow-up). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
LukasWodka
approved these changes
Jul 7, 2026
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Jul 7, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves the two new Cursor Bugbot findings on #164 (same never-lie / fail-fast class as the prior rounds).
High — keep-data save failure left a stale on-disk pointer + clean closing
Under
--keep-data, the active-client fields are cleared in memory, but ifcfg.Save()failed the on-disk config still named the revoked client and the closing line could still read as a clean offboard. Now that Save failure marks the offboarddegraded(honest closing) and the warning points the user attracebloc logout/ manual removal.Medium — online guard softened HTTP 426
The pre-offboard online check treated any
lookupClientStatuserror — including*api.UpgradeRequiredError(426, CLI too old) — as warn-and-continue. A 426 won't recover by proceeding (the whole offboard hits the same backend), so it now fails fast with the upgrade message, matchingrunClientStatus. Transient errors (5xx/429/network) still warn and continue, since the teardown is the real gate.Note on scope of
degradeddegradedintentionally tracks tracebloc-side / enrollment state left behind (release, cluster, on-host data, the active-client pointer). Image reclaim and CLI self-removal are local-disk niceties with their own actionable hints and are excluded — the machine is genuinely offboarded from tracebloc's side once the credential is revoked, so those don't flip the closing to a warning.Tests
Added: a 426 during the guard fails fast with the upgrade message and runs neither revoke nor any teardown.
go build/vet/test ./...green (11 pkgs).Rolls up under §7.10 offboarding (Bugbot follow-up — no separate ticket).
🤖 Generated with Claude Code
Note
Low Risk
Targeted offboarding UX and error-handling fixes in the CLI delete path; no auth or API contract changes beyond aborting delete earlier on 426.
Overview
Pre-offboard online guard now treats HTTP 426 (
*api.UpgradeRequiredError) as fail-fast with the standard upgrade message instead of warn-and-continue. Transient lookup errors (5xx, 429, network) still warn and skip the guard, since teardown is the real safety gate.Under
--keep-data, if clearing the active-client pointer in memory succeeds butcfg.Save()fails, offboard is markeddegradedso the closing line does not read as a full success, and the warning directs users totracebloc logoutor manual config cleanup.Adds
TestDelete_Guard426_FailsFastto assert no revoke or teardown runs after a 426 on the status lookup.Reviewed by Cursor Bugbot for commit 3708e15. Bugbot is set up for automated code reviews on this repo. Configure here.