Repository navigation
fix(client): keep cache tags on pointer-slice envelopes and renamed stream entities - #133
Merged
Merged
Conversation
…tream entities
Two ways a generated client lost its cache contract without failing:
- A Go `[]*T` reaches the document as items of `oneOf: [$ref T, {type:
object, nullable: true, enum: [null]}]`, the OpenAPI 3.0 null idiom the
router writes itself. compositionTarget only skipped `type: "null"`, so the
null member read as an unnamed type and every pointer-slice envelope
provided no tags. isNullSchema recognizes both spellings, as the codec
generators already did.
- resolveStreamEntityNames ran per source. A type renamed only in the
OpenAPI document (it collides there, not in the AsyncAPI one) kept its bare
name in the stream binding, so frames upserted `Target:7` while REST reads
held `CloudprofilesTarget:7`. MergeSpecs now re-resolves bindings against
the merged schemas.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Conventional Commits ValidationPR Title: valid |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
juicycleff
added a commit
that referenced
this pull request
Nov 20, 2026
cmd/forge v1.14.2 still required the root module at a pseudo-version from before the release, so `go install github.com/xraph/forge/cmd/forge@v1.14.2` built the client generator without #133: pointer-slice envelopes lost their cache tags and stream entities kept their bare names. The root module's v1.14.2 has the fix; the CLI just didn't use it.
This branch was successfully deployed
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.
Two ways a generated TypeScript client silently lost its cache contract, so a write or a live event refreshed nothing and pages stayed stale until a reload. Both were found in Loomplane's dashboard, where they disabled list invalidation across most of its Cloud screens.
Pointer-slice envelopes provided no tags
A Go
[]*Treaches the OpenAPI document as array items ofoneOf: [$ref T, {type: object, nullable: true, enum: [null]}], the OpenAPI 3.0 null idiom the router writes itself.compositionTargetskipped only members withtype: "null", so the null member read as an unnamed type and the whole envelope as a wrapper around nothing: no entity, norootType, noprovides. Everyx-forge-envelopeover a pointer slice was affected, declared or inferred, and mutations invalidatingT[]reached no query.isNullSchemanow recognizes both spellings, as the TypeScript and Dart codec generators already did. In Loomplane this brought 12 declared envelopes back (PlanningCloudList,CloudTargetList,CloudSyncList,PoolList,ServerList,ZoneList,OperationListand others), plus several inferred ones. The generator's warning for these blamed "an inline object", which hid the cause.Stream bindings kept the bare type name
resolveStreamEntityNamesrenames a binding's entity to the component the document actually holds, matching onx-forge-type. It ran per source. A type renamed only in the OpenAPI document, because it collides there and not in the AsyncAPI one, kept its bare name in the binding: frames upsertedTarget:7while every REST read heldCloudprofilesTarget:7, so live updates never reached the screen. Loomplane hit this forTarget,DeploymentandSource.MergeSpecsnow re-resolves stream bindings against the merged schemas. It copies the bindings first, so the source specs are not mutated.Tests
TestEnvelopeOverPointerSliceProvidesCollectionTag(declared and inferred) fails without the fix and passes with it;TestNullableEnumWithValuesIsNotNullguards the boundary.TestMergeSpecsRenamesStreamEntityToRESTComponentcovers the rename and checks the source binding is untouched.go test ./internal/client/passes.internal/client/generators/typescripthastsc-dependent tests that fail in a checkout without its node toolchain; they fail identically onmainthere.