mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-13 15:22:12 +02:00
Use tagged errors for dispatch RPC
This commit is contained in:
parent
1d45307387
commit
39db6d8235
3 changed files with 25 additions and 4 deletions
|
|
@ -1429,6 +1429,27 @@ Notes:
|
||||||
- `cd ts && bun run lint`
|
- `cd ts && bun run lint`
|
||||||
- `git diff --check`
|
- `git diff --check`
|
||||||
|
|
||||||
|
### 2026-06-02: RPC Dispatch Tagged Error Slice
|
||||||
|
|
||||||
|
- Status: migrated and package-verified.
|
||||||
|
- Completed:
|
||||||
|
- Replaced the remaining production `S.ErrorClass` usage in the Flow gateway
|
||||||
|
RPC contract with `S.TaggedErrorClass`.
|
||||||
|
- Normalized the client-side RPC `DispatchError` counterpart to the same
|
||||||
|
tagged-error schema shape so both wire contract copies stay aligned.
|
||||||
|
- Closed the scratch-note `S.ErrorClass` finding for production code. The
|
||||||
|
remaining plain `new Error` matches are test-only helpers or external
|
||||||
|
host-boundary simulations.
|
||||||
|
- Verification:
|
||||||
|
- `cd ts && bun run check:tsgo`
|
||||||
|
- `cd ts/packages/flow && bunx --bun vitest run src/__tests__/gateway-dispatcher.test.ts`
|
||||||
|
- `cd ts/packages/client && bunx --bun vitest run src/__tests__/rpc-timeout.test.ts`
|
||||||
|
- `cd ts && bun run check`
|
||||||
|
- `cd ts && bun run build`
|
||||||
|
- `cd ts && bun run test`
|
||||||
|
- `cd ts && bun run lint`
|
||||||
|
- `git diff --check`
|
||||||
|
|
||||||
## Subagent Findings To Preserve
|
## Subagent Findings To Preserve
|
||||||
|
|
||||||
- MCP/workbench:
|
- MCP/workbench:
|
||||||
|
|
@ -1485,6 +1506,8 @@ Notes:
|
||||||
Socket errors/JSON parsing now use tagged errors and Schema decoding.
|
Socket errors/JSON parsing now use tagged errors and Schema decoding.
|
||||||
The remaining client `newableFactory` assertions are documented as public
|
The remaining client `newableFactory` assertions are documented as public
|
||||||
API compatibility boundaries for this loop.
|
API compatibility boundaries for this loop.
|
||||||
|
- Gateway/client `DispatchError` contracts now use `S.TaggedErrorClass`; do
|
||||||
|
not reopen `S.ErrorClass` unless a new production match appears.
|
||||||
- Gateway `DispatchStream` now uses Effect-native dispatcher streaming
|
- Gateway `DispatchStream` now uses Effect-native dispatcher streaming
|
||||||
callbacks instead of nested `Effect.runPromiseWith`, and client streaming
|
callbacks instead of nested `Effect.runPromiseWith`, and client streaming
|
||||||
facade callbacks now decode the legacy envelope through Schema before
|
facade callbacks now decode the legacy envelope through Schema before
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,7 @@ export class DispatchStreamChunk extends S.Class<DispatchStreamChunk>("DispatchS
|
||||||
complete: S.Boolean,
|
complete: S.Boolean,
|
||||||
}) {}
|
}) {}
|
||||||
|
|
||||||
export class DispatchError extends S.ErrorClass<DispatchError>("DispatchError")({
|
export class DispatchError extends S.TaggedErrorClass<DispatchError>()("DispatchError", {
|
||||||
_tag: S.tag("DispatchError"),
|
|
||||||
message: S.String,
|
message: S.String,
|
||||||
}) {}
|
}) {}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,7 @@ export class DispatchStreamChunk extends S.Class<DispatchStreamChunk>("DispatchS
|
||||||
complete: S.Boolean,
|
complete: S.Boolean,
|
||||||
}) {}
|
}) {}
|
||||||
|
|
||||||
export class DispatchError extends S.ErrorClass<DispatchError>("DispatchError")({
|
export class DispatchError extends S.TaggedErrorClass<DispatchError>()("DispatchError", {
|
||||||
_tag: S.tag("DispatchError"),
|
|
||||||
message: S.String,
|
message: S.String,
|
||||||
}) {}
|
}) {}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue