Repository navigation
feat: add Capacitor mobile runtime support - #74
Merged
Merged
Conversation
Copilot stopped reviewing on behalf of
pietrodicaprio due to an error
September 1, 2026 12:46
Add embedded WASM delivery, an opt-in native iOS SSC transport with exact-origin and bounded-queue controls, browser/iOS tests, and a macOS CI gate. Browser WebSocket remains the compatibility default.
Close and generation-fence the previous transport, clear resume and delivery state, fail pending calls, and preserve only registrations owned by components that remain mounted.
pietrodicaprio
force-pushed
the
docs/capacitor-mobile-release
branch
from
September 1, 2026 13:01
2a57d94 to
bd39268
Compare
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
Add the first opt-in Capacitor mobile runtime path for RFW without changing the browser defaults:
build.delivery: "embedded"for optimized raw WASM packaged inside a native container;build.sscTransport: "capacitor"and a fail-closed Go/WASM transport selector;URLSessionWebSocketTask;hostclient.ResetSession()for exact authenticated-identity changes;The existing defaults remain
delivery: "network"andsscTransport: "browser".Why
Capacitor local asset handlers do not reliably serve precompressed WASM with the matching
Content-Encoding, so a production packaged application needs to load the optimized raw bundle it ships rather than fall back from a network compression contract.On physical iOS, native HTTP retained the Secure host cookie while a WebSocket opened by WKWebView did not present it to the same remote host. The native SSC transport keeps cookie ownership in the shared native
URLSessioncookie jar and carries only protocol frames and lifecycle events across the Capacitor bridge.Physical multi-user testing also exposed a separate lifecycle boundary: replacing the HTTP cookie did not replace an already-open SSC connection, so the shell could show Alice while host-bound variables still belonged to Bob.
ResetSessionmakes that transition explicit and immediate.Build contract
build.deliveryis independent ofbuild.type:networkpreserves the existing compressed/negotiated production path;embeddedremoves stale.br/.gzartifacts, keeps optimizedapp.wasm, stampsRFW_WASM_DELIVERY, and makes the loader request only that packaged file;rfw_config.jsnow stampsRFW_SSC_TRANSPORT. Selectingcapacitornever silently falls back to a browser WebSocket when Capacitor or the plugin is missing.Native iOS trust boundary
The local
mobile/capacitor-sscpackage:HTTPCookieStorage.shared;There is deliberately no Android implementation in this PR.
Authenticated identity reset
hostclient.ResetSession():hostclient.ErrSessionResetto interrupted typed calls;The consumer contract is: fail guards closed and unmount user-owned scopes, release app feeds and wipe user stores, call
ResetSession, then install the new claims and mount the replacement route.Dependency on PR #72
This is a stacked PR based on #72 at
07566500ba03a7fdbc0143bcda886059ad48bfd1.The reset contract relies on #72's cleanup-capable host registrations and
router.Revalidate()behavior: user-owned scopes must be removed before reset so only genuinely app-lifetime registrations survive. After #72 merges, this PR can be retargeted tomainwithout carrying an application workaround.Verification
Post-rebase gates on the exact pushed commits:
go test ./...go test -race ./...go vet ./...GOOS=js GOARCH=wasm go build ./...GOOS=js GOARCH=wasm go vet ./....github/scripts/wasmbrowsertest-retryGOOS=js GOARCH=wasm go test -count=20 -exec wasmbrowsertest ./hostclientnpm run verify:ios: 8/8 iOS Simulator testsapp.wasmPhysical iOS observations:
/deep/alphaApp API payload with the guarded owner and route parameter mounted;The workflow adds a macOS
Test (iOS native SSC)job and makes it a release dependency.Publication boundary
The full Capacitor release guide remains local and is intentionally excluded from this PR. The package README contains only the minimum integration and verification contract. External-app Universal Link resolution and Android runtime/device validation remain separate gates.