Skip to content

feat(rdws): add supervisor-update methods and fix GetLogs - #13

Merged
kkennedy-bs merged 1 commit into
mainfrom
feat/rdws-supervisor-update-methods
Jul 30, 2026
Merged

feat(rdws): add supervisor-update methods and fix GetLogs#13
kkennedy-bs merged 1 commit into
mainfrom
feat/rdws-supervisor-update-methods

Conversation

@kkennedy-bs

Copy link
Copy Markdown
Contributor

Adds the rDWS methods needed to drive and observe a supervisor update on a player, and fixes GetLogs so it can succeed at all.

New RDWSService methods (each follows the existing rdws.go shape: validate, ensure auth + network context, build the destination-scoped URL, unwrap data.result):

  • TriggerUpdateSync POST /update/sync
  • GetStoredSupervisors GET /system/supervisors
  • DeleteSupervisors POST /system/supervisors/delete (builds/clear are
    mutually exclusive; rejected client-side too)
  • GetCrashDumpFiles GET /logs/crash-dumps
  • GetSystemInfo GET /system -- EXPERIMENTAL: an Internal-tier,
    undocumented route, reachable only because the rDWS
    passthrough originates from localhost. It is the only
    source for the running supervisor version, so it is
    provided with a caveat rather than left to every
    caller to hand-roll.

Fixes:

  • GetLogs treated a string result as a device error, but GET /logs returns dmesg AS a string, so the method could never succeed on a healthy player. A string result is now the success case (RDWSLogs.Text); a structured list is still accepted. Genuine device errors arrive as non-2xx and are handled before this parse, so nothing is lost.

New public type aliases in gopurple.go so external consumers can use the new methods without importing internal/types. RDWSLogs gains a Text field additively; no existing field or signature changes, so this is a safe drop-in.

Tests: parseLogsResult and parseCrashDumpList table tests (the log fix fails against the prior logic, confirming it tests the fix), plus interface conformance, empty-serial/no-auth guards, request-shape validation, and response-parsing for the system-info and stored-supervisor shapes.

Adds the rDWS methods needed to drive and observe a supervisor update on a
player, and fixes GetLogs so it can succeed at all.

New RDWSService methods (each follows the existing rdws.go shape: validate,
ensure auth + network context, build the destination-scoped URL, unwrap
data.result):

  - TriggerUpdateSync      POST /update/sync
  - GetStoredSupervisors   GET  /system/supervisors
  - DeleteSupervisors      POST /system/supervisors/delete  (builds/clear are
                           mutually exclusive; rejected client-side too)
  - GetCrashDumpFiles      GET  /logs/crash-dumps
  - GetSystemInfo          GET  /system  -- EXPERIMENTAL: an Internal-tier,
                           undocumented route, reachable only because the rDWS
                           passthrough originates from localhost. It is the only
                           source for the running supervisor version, so it is
                           provided with a caveat rather than left to every
                           caller to hand-roll.

Fixes:

  - GetLogs treated a string result as a device error, but GET /logs returns
    dmesg AS a string, so the method could never succeed on a healthy player.
    A string result is now the success case (RDWSLogs.Text); a structured list
    is still accepted. Genuine device errors arrive as non-2xx and are handled
    before this parse, so nothing is lost.

New public type aliases in gopurple.go so external consumers can use the new
methods without importing internal/types. RDWSLogs gains a Text field
additively; no existing field or signature changes, so this is a safe drop-in.

Tests: parseLogsResult and parseCrashDumpList table tests (the log fix fails
against the prior logic, confirming it tests the fix), plus interface
conformance, empty-serial/no-auth guards, request-shape validation, and
response-parsing for the system-info and stored-supervisor shapes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@kkennedy-bs
kkennedy-bs merged commit 3351184 into main Jul 30, 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.

1 participant