Repository navigation
Windows shell: carry every server request through one HTTP adapter - #68
Merged
Merged
Conversation
The shell's DTOs mirror the core's new wire: ServerRequest replaces the six request effects, ServerResponse the seven settle commands, the delete commands carry newDeviceId and RequestSignInLink an optional platform. SyncServer.CarryAsync sends any ServerRequest verbatim (method, base URL + path, Bearer token, JSON body) and answers with its ServerResponse: status and body, or 0 for no sync server, a network error, a timeout or a cancellation. The typed SyncApi client and its response types are gone; SyncConfig stays. The view model routes ServerRequest by an explicit case, settles every request (the sign-out revoke included) on the UI thread via the dispatcher queue, and sends platform "windows" for the link hand-off. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 3, 2026
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.
Summary
The Windows shell now carries every
ServerRequestfrom the core through one HTTP adapter, with no branch per request, and settles each one withServerResponse.Apply(update) foreach effect … - default: CarryRequest(effect) # 6-way switch → typed SyncApi → 7 settle commands + case ServerRequestEffect r: CarryAndSettleAsync(r) + response = SyncServer.CarryAsync(r) # method, base URL + path, Bearer?, JSON body verbatim + # → ServerResponse { id, status, body }; 0 on no server / error / timeout / cancel + dispatcher.TryEnqueue(Send(response)) # on the UI thread, never inside the dispatch that is still runningRequestSignInLinksendsplatform: "windows", so the emailed link still hands off to the app.Evidence
WinUI can't build on this Linux box, so the evidence comes from three scratch net8.0 projects that compile the shell's own source files. None of them are committed.
HttpMessageHandler:SyncServer.cs/ServerRequestEffectmissing). After: 15/15 pass.AppViewModel.cstypecheck: compiled against CommunityToolkit.Mvvm 8.4.0, with stubs only for the WinUI types and the audio/SMTC/power/tick services, and warnings treated as errors. Build succeeded.cascade-uniffi, driven throughCoreBridgewith the adapter answering from a fake server.cargo test --workspace: everything passes. The core is unchanged.Merge Danger
Door: two-way
There is no data migration, and the wire only changes between this shell and the core it ships with.
Blast Radius: Windows-only
If something is wrong, sign-in or sync breaks on Windows. Playback is untouched. Nobody has run the real WinUI app on Windows yet (see below).
Unaddressed findings
Standards
SyncServer(baseUrl, http)constructor parameters. Kept. They are the seam the adapter tests use: a fake handler for status, body and errors, and an empty base URL for "no sync server". There is no Windows test project in the repo to host those tests yet.SyncConfig.AvailablevsCarryAsync's empty-base-URL check). Kept. The ADR requires status 0 with no server whatever produced the request, and the adapter only knows the base URL it was given. Both default toSyncConfig.ApiBase.HasThreadAccessfast path is gone). No change, on purpose. With no server the response is already there whileApplyis still running, so settling inline would re-enter it.(Applied: the view model's
CarryAsyncwas renamed toCarryAndSettleAsync, so it no longer shares a name withSyncServer.CarryAsync.)Spec
TryEnqueuereturns false. No change. That only happens while the dispatcher is shutting down at app exit, when there is no core left to settle.HttpClienttimeout. No change. The shell has no other cancel path, and a timeout settles with status 0 as required.Closes #62
🤖 Generated with Claude Code