You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Include.Surface["included"] and the flat groups' included slot widen decoding services to unknown #595
Relayed from preferenceflow#382 phase 2, which is blocked on this. website and gardeneria are probably affected too.
What's wrong
Include.make(Resource, spec)'s included is Included<S>, the union of the member resources. When a member's relationships use lazyTarget (Relationship.many(lazyTarget(...))), that union's DecodingServices is unknown. The unknown then spreads:
Passed to Document.wire(…) or DataDocument({ included }), it carries unknown into every endpoint's success schema.
Group.flat / flatReadOnly do the same, because their included slot is WireSchema<Schema.Top, TM>.
As a result, typed Client.make methods require unknown services, and effect/cli commands fail Command<…, HttpClient | …> assignability.
Building CollectionDocument(Document.wire(ElectionEvent, …), { included: Document.wire(surface.included, …) }) into a group gives 4 errors in apps/cli.
The app works around it with a Codec<…, never, never> cast.
Fix
Type Included<S> and the flat groups' slot over the members' concrete schemas, so the services stay never; or make lazyTarget's suspended target declare never services.
Add a type test: a Client.make method over a lazy-target include surface requires only HttpClient.
Activity
fix(Group): keep a flat group's include surface in its success schemas (
fix(Group): a flat group without a surface keeps its unconstrained in…
fix(Group): keep a flat group's include surface in its success schemas (
fix(Group): a flat group without a surface keeps its unconstrained in…
fix(Group): keep a flat group's include surface in its success schemas (
fix(Group): a flat group without a surface keeps its unconstrained in…
feat(Assemble, ResourceHandlers): type `included` by the include regi…