-
Notifications
You must be signed in to change notification settings - Fork 0
systems transport parity
Active contributors: Douwe de Vries
Transport parity keeps browser HTTP mode and desktop Tauri mode equivalent. A user operation should have one shared workflow and matching frontend, HTTP, and Tauri contract surfaces.
src/api/app.rs
src/api/handlers.rs
src-tauri/src/main.rs
src-tauri/src/commands.rs
frontend/src/services/
├── tauri.ts
├── tauriCommands.ts
└── apiRoutes.ts
tests/transport_parity_integration.rs
| Name | File | Description |
|---|---|---|
TRANSPORT_PARITY_ROUTE_PATHS |
src/api/app.rs |
Canonical HTTP route list covered by parity tests. |
tauri_commands! |
src-tauri/src/main.rs |
Canonical Tauri command registration list. |
TAURI_COMMANDS |
frontend/src/services/tauriCommands.ts |
Frontend command name constants. |
build*Route functions |
frontend/src/services/apiRoutes.ts |
Frontend HTTP route builders. |
isTauri |
frontend/src/services/tauri.ts |
Runtime switch between Tauri and browser implementations. |
graph LR
UI[UI action] --> Switch[frontend/src/services/tauri.ts]
Switch -->|browser| Routes[apiRoutes.ts -> src/api/app.rs]
Switch -->|desktop| Commands[tauriCommands.ts -> src-tauri/src/main.rs]
Routes --> Workflow[src/backend/workflow.rs]
Commands --> Workflow
Tests catch drift between route constants, command constants, and command registration. Browser tests alone cannot prove desktop parity, so changes must update both runtime paths.
src/api/handlers.rs and src-tauri/src/commands.rs should call shared workflow functions in src/backend/workflow.rs. Type drift is handled by paired edits in src/backend/requests.rs, src/presentation/responses.rs, and frontend/src/types/api.ts.
When adding an operation, update all four surfaces: frontend service, HTTP route/handler, Tauri command/registration, and tests. If the operation is browser-only or desktop-only, document why and avoid exposing a misleading shared function.
| File | Purpose |
|---|---|
src/api/app.rs |
HTTP route constants and parity route list. |
src-tauri/src/main.rs |
Tauri command registration macro. |
src-tauri/src/commands.rs |
Command implementations. |
frontend/src/services/tauri.ts |
Runtime transport switch. |
tests/transport_parity_integration.rs |
Transport parity coverage. |