Repository navigation
Carry a machine-readable reason on every sync API failure - #5
Merged
Merged
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every sync API failure now carries a machine-readable reason, so a current
CoreSync.Http.Clientcan tell the user what happened instead of "check your connection". Requires adospace/CoreSync#21 (the submodule points at that branch).What changes
X-CoreSync-ErrorandX-CoreSync-Traceheaders and aSyncErrorDetailsbody on every sync API failure.1b06f14maps each status statement 1:1.AgentOperationFailedException, derived fromAgentOfflineException) still returns 503 with the same body and log. Only the newagent-errorcode tells it apart fromagent-unavailable.Compatibility
Tests
59/59: 51 existing plus 8 new (
SyncControllerTests,AgentFailureResponseTests).