Skip to content

docs: align device sync protocol page with the server implementation - #149

Draft
sdornan wants to merge 2 commits into
mainfrom
claude/new-session-iabs8x
Draft

sdornan wants to merge 2 commits into
mainfrom
claude/new-session-iabs8x

Conversation

@sdornan

@sdornan sdornan commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

docs/developers/device-sync-protocol.md didn't match what the RomM server implements. A client built from the old page would fail against a real server. This PR rewrites the page to match the backend (backend/endpoints/device.py, backend/endpoints/sync/, backend/endpoints/saves.py, backend/endpoints/play_sessions.py and their response schemas).

Changes

  • Authentication: explains that both Client API Tokens and web sessions (cookie plus CSRF) work, and replaces the scope table with the actual scope for each endpoint. For example, POST /api/play-sessions needs roms.user.write, not me.*.
  • Device registration: the real body fields (mac_address, client, client_version, sync_config, allow_existing, allow_duplicate, reset_syncs, with no paths). The real sync_mode values (api, file_transfer, push_pull). How idempotent matching works, and the { device_id, name, created_at } response with a string UUID device_id.
  • Negotiate: the flat saves[] + rom_ids request with an MD5 content_hash, pairing on (rom_id, slot), and the error codes (400/404). The response uses an integer session_id, action instead of type, no_op, save_id, and the total_* counts. Removes the destination/source/dest_path/resolution fields, which don't exist.
  • Moving bytes (new section): upload with overwrite/autocleanup and the 409 guard, PUT update, download with optimistic, and the /downloaded confirmation.
  • Complete session: start_time/end_time/duration_ms/save_slot, the response shape, and the standalone /api/play-sessions alternative.
  • Briefly mentions the session list/detail and push-pull endpoints.

Frontmatter, title and "See also" links are kept. The page passes prettier and markdownlint with the repo's Trunk configs.

AI disclosure

This change was written with AI assistance (Claude Code), working from a comparison of the page against the RomM server source. Please review it against the backend before merging.

🤖 Generated with Claude Code

https://claude.ai/code/session_013q3PdG4Zfn6QWeBCRnC1sm

sdornan and others added 2 commits September 25, 2026 03:04
Correct scopes, device registration fields and response, negotiate
request/response shapes, and session completion payload. Document the
save upload/download/confirm endpoints and list RomM Desktop as a
reference client.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013q3PdG4Zfn6QWeBCRnC1sm

This branch has not been deployed

No deployments
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.

1 participant