Skip to content

Carry a machine-readable reason on every sync API failure - #5

Merged
adospace merged 3 commits into
mainfrom
feature/sync-error-classification
Oct 19, 2026
Merged

adospace merged 3 commits into
mainfrom
feature/sync-error-classification

Conversation

@adospace

Copy link
Copy Markdown
Owner

Every sync API failure now carries a machine-readable reason, so a current CoreSync.Http.Client can tell the user what happened instead of "check your connection". Requires adospace/CoreSync#21 (the submodule points at that branch).

What changes

  • The X-CoreSync-Error and X-CoreSync-Trace headers and a SyncErrorDetails body on every sync API failure.
  • Status codes unchanged: 404 for an unknown or unpublished endpoint or an expired session, 503 for an agent that is offline or failed, 422 for an unsupported store configuration. The parity check against 1b06f14 maps each status statement 1:1.
  • An agent that answers with an error (AgentOperationFailedException, derived from AgentOfflineException) still returns 503 with the same body and log. Only the new agent-error code tells it apart from agent-unavailable.
  • Unexpected exceptions still propagate to the host (exception handler, Sentry); they only get the headers added.
  • Package updates for the NuGet audit: the .NET 10 servicing set 10.0.9 → 10.0.13 (WebAssembly.Server CVE-2026-102870, CVE-2026-96230) and MessagePack 3.1.7 → 3.1.12 (GHSA-qhrr-8q5h-9q3h).

Compatibility

  • Existing 1.0.x clients see the same status codes and bodies as before.
  • In production on RTR Sync Server since 2026-10-19. Current clients synced against it, including a full initial sync, with zero 5xx.

Tests

59/59: 51 existing plus 8 new (SyncControllerTests, AgentFailureResponseTests).

The sync API keeps the status codes clients have always received (404 for an unknown endpoint or
an expired upload/download session, 503 for an offline agent, 422 for an unsupported store
configuration) and adds the X-CoreSync-Error / X-CoreSync-Trace headers plus a SyncErrorDetails
body, so a current CoreSync.Http.Client can tell the user what happened instead of "check your
connection". Unexpected exceptions still propagate to the host (exception handler, Sentry) and only
get the headers attached to the host's response.

AgentProxySyncProvider now tells an agent that answered with an error (HubException) apart from
an agent that is offline or did not answer: the former is a failure of the data store behind the
agent and propagates like any other provider failure instead of being reported as 503 agent offline.

Bumps the CoreSync submodule to the commit introducing the error classification.
A server-only deploy must look exactly like today to the 1.0.1 clients in the field, so an agent that
answers a sync RPC with an error is again a 503 with the same body and the same warning log as
before, instead of propagating as an unhandled 500. AgentOperationFailedException now derives from
AgentOfflineException with the legacy message; what tells the two cases apart is only the new
agent-error code header (not permanent, so clients keep retrying as they did) next to
agent-unavailable for an agent that did not answer.

Also guards the OnStarting header registration against a response that has already started and
documents that a bare Kestrel 500 carries no header. Bumps the CoreSync submodule.
Microsoft.AspNetCore.Components.WebAssembly.Server 10.0.9 carries CVE-2026-102870 and
CVE-2026-96230 (GHSA-g27p-qf6j-c96c, GHSA-qjpx-jqm5-h2c4), fixed in 10.0.13; the rest of
the 10.0.9 set moves with it so the Blazor server and client packages stay aligned.
MessagePack 3.1.7 is affected by GHSA-qhrr-8q5h-9q3h, fixed in 3.1.9. The NuGet audit
fails restore on both with warnings as errors.

Bumps CoreSync to 9894eb1 (MessagePack 3.1.12).
@adospace
adospace merged commit e9a1b65 into main Oct 19, 2026
2 checks 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