Tell an invalid roster apart from an unreachable server #1

Merged
nicolas merged 1 commit from fix/api-contract into main 2026-09-09 12:58:06 +00:00
Owner

Backport of the Android API fixes (driver-android #2, #3).

  • ShiftServiceError.invalid(detail:): a 200 that is not a roster (login page, web front at the wrong address, drifted shape) is reported with the decoder's reason instead of reading like being offline. Banner: "Le serveur répond, mais pas avec une feuille de service." with the settings offered; the connection test now decodes the answer, so a wrong address is caught where it is typed.
  • The day's notice and documents fail silently at the service level: a server with only the shift endpoint reads as "nothing to show".
  • ShiftServiceTests: HTML → invalid, drifted shape names the missing field, a real roster decodes, a dead host is unreachable.

🤖 Generated with Claude Code

Backport of the Android API fixes (driver-android #2, #3). - `ShiftServiceError.invalid(detail:)`: a 200 that is not a roster (login page, web front at the wrong address, drifted shape) is reported with the decoder's reason instead of reading like being offline. Banner: "Le serveur répond, mais pas avec une feuille de service." with the settings offered; the connection test now decodes the answer, so a wrong address is caught where it is typed. - The day's notice and documents fail silently at the service level: a server with only the shift endpoint reads as "nothing to show". - `ShiftServiceTests`: HTML → invalid, drifted shape names the missing field, a real roster decodes, a dead host is unreachable. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Backported from the Android client. A 200 that is not a roster — a
login page, a web front at the wrong address, a payload whose shape
drifted — used to escape the decoder as a generic failure and read
exactly like being offline. It is now ShiftServiceError.invalid,
carrying the decoder's reason. The day banner says the server answers
but not with a feuille de service and offers the settings; the
connection test decodes the answer rather than merely fetching it, so a
wrong address is caught where it is typed.

The day's notice and documents now fail silently at the service, not
only at the call sites: the shift endpoint is the whole contract, and a
server that has only it must read as "nothing to show".

Tests cover HTML, a drifted shape, a real roster, and a dead host.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
nicolas deleted branch fix/api-contract 2026-09-09 12:58:06 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
glong/driver!1
No description provided.