feat(api): switch share/user wire ids to UUID - #45
Merged
Conversation
Paired with #22: the server replaces numeric share/user ids with UUIDs on the public API. CLI must move in lockstep, otherwise in-flight --watch processes start failing PUT /api/shares/{id} with HTTP 404 once the server deploys. - signupResp.UserID -> UserUUID; shareResp.ID -> UUID - UpdateShare / DeleteShare take the share UUID; path becomes /api/shares/<uuid> - watchPusher.shareID -> shareUUID; shares still keyed by short_id in ~/.gander (UUIDs are ephemeral on the CLI side) - Remove keeps the same UX (short_id / filename / URL); only the delete call uses the resolved UUID - Help text --pick <id> -> --pick <short_id> - Tests: mock handlers return uuid; removeFixture tracks deletedUUIDs; new TestAPIClientUsesUUIDInSharePath asserts the UUID is sent in the path, not a numeric id Closes #44
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.
Summary
signupResp.UserID int64→UserUUID string(JSON taguser_uuid);shareResp.ID int64→UUID string(json:"uuid").UpdateShare/DeleteSharenow take the share UUID and call/api/shares/<uuid>.watchPusher.shareID→shareUUID;cfg.Shares[absPath]still keyed byshort_id(UUIDs are ephemeral — we resolve them fresh per process).removeUX unchanged (still works offshort_id/ filename / URL); only the delete call uses the resolved UUID.--pick <id>→--pick <short_id>.uuid;removeFixturetracksdeletedUUIDs; newTestAPIClientUsesUUIDInSharePathasserts the UUID is sent in the path, not a numeric id.Related Issue
Closes #44
Paired with #22 — both repos need to ship together (CLI before or alongside the server deploy). Older CLIs will start failing
PUT /api/shares/{id}with HTTP 404 once the server rolls.Testing
go test ./...— all passing (including new regression assertion thatUpdateShare/DeleteSharePUT/DELETE to/api/shares/<uuid>, not/api/shares/1).go vet ./...— clean.go build ./...— clean.Notes
~/.gandercontinues to storeshort_id → pathmappings only.short_idremains the human-friendly share URL identifier and the--pickargument.