Skip to content

feat(api): switch share/user wire ids to UUID - #45

Merged
scott merged 1 commit into
mainfrom
feat/44-uuid-share-ids
Aug 17, 2026
Merged

feat(api): switch share/user wire ids to UUID#45
scott merged 1 commit into
mainfrom
feat/44-uuid-share-ids

Conversation

@scott

@scott scott commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • signupResp.UserID int64UserUUID string (JSON tag user_uuid); shareResp.ID int64UUID string (json:"uuid").
  • UpdateShare / DeleteShare now take the share UUID and call /api/shares/<uuid>.
  • watchPusher.shareIDshareUUID; cfg.Shares[absPath] still keyed by short_id (UUIDs are ephemeral — we resolve them fresh per process).
  • remove UX unchanged (still works off 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.

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 that UpdateShare/DeleteShare PUT/DELETE to /api/shares/<uuid>, not /api/shares/1).
  • go vet ./... — clean.
  • go build ./... — clean.

Notes

  • No config-schema migration needed: ~/.gander continues to store short_id → path mappings only.
  • short_id remains the human-friendly share URL identifier and the --pick argument.

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
@scott
scott merged commit 0df5a5c into main Aug 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: switch share/user wire identifiers from numeric id to UUID

1 participant