Confirm before handing a fleet away, and say what a release does - #21
Merged
Conversation
fleet transfer was the one destructive verb that sent its request with no question asked: piping "n" into it still moved the fleet, its devices and its credit to another account, and the server never re-adds the old owner. It now resolves the fleet, names it and the recipient, and reads the answer first. device release asked about the fleet and never the device, so every device in a fleet produced the same question and a mistyped IMEI read exactly like the device meant. It names the device by its own name now, falling back to the IMEI when it has none. Both verbs claimed a release erases everything on the device. It clears the fleet, after which the device wipes its files and restarts its code, so the firmware, the device key and the SIM identity all survive. The table entry, the release question and the fleet delete question say that instead. Key stands alone nowhere a user reads: the table section, the empty lists, the revoke question and both key success lines say fleet key. The KEY column header stays, since the columns beside it already name the fleet and widening it would skew every row against the server's five-character suffix. Success lines name what they acted on, the way a question already does, so "Deleted %q." and "Released the device." became "Deleted fleet %q." and "Released device %q from fleet %q." fleet delete, key create, key revoke and member remove printed a line no test read, which is how the old wording drifted unnoticed. Each asserts it now, and every new assertion was checked against the deletion it exists to catch. No version change, and nothing under .github, flake.nix, .goreleaser.yaml or go.mod is touched.
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 free
to 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.
The first of three cycles closing findings from the two architecture reviews of the refactor. This one covers every finding where a user loses something they cannot get back, plus the words attached to those acts.
fleet transferwas the one destructive verb that sent its request with no question asked. Against a stub server, pipingnintofleet transfer 3 <address>still sentPOST /fleets/{id}/ownerand printed success. The server setsowner_idto the target and deletes their membership row, and never re-adds the old owner, so the fleet, its devices and its credit are gone with no way back from the CLI. It now resolves the fleet, names it and the recipient, and reads the answer before sending.device releaseasked about the fleet and never the device, so every device in a fleet produced a byte-identical question. A mistyped IMEI landing on another device you own read exactly like the device you meant, and re-claiming needs someone at the hardware pressing its pairing button. It now names the device by its own name, falling back to the IMEI when it has none.Both verbs told the user a release erases everything on the device.
CONTEXT.mdanddocs/design.mdsay it clears the fleet, after which the device wipes its files and restarts its code: the firmware, the device key and the SIM identity all survive.keystands alone nowhere a user reads. TheKEYcolumn header stays as it is, because the columns beside it already name the fleet and widening it would skew every row against the server's five-character suffix. That fragility is noted for a later cycle rather than changed here.Success lines now name what they acted on, the way a question already does.
fleet delete,key create,key revokeandmember removeeach printed a line no test read, which is how the old wording drifted unnoticed in the first place.Evidence
gofmt -l .clean,go mod tidyleavesgo.modandgo.sumunchanged,go vet ./...clean,go test -count=1 ./...all ten packages pass with no skips.nnow stops afterGET /fleetsand sends noPOST, and answeringysends it.No version change, and nothing under
.github,flake.nix,.goreleaser.yamlorgo.modis touched. Paired with a documentation change insuperstack-server.