-
Notifications
You must be signed in to change notification settings - Fork 1.9k
docs(migration): align four passages with the implementation #2388
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
felixweinberger
merged 1 commit into
main
from
fweinberger/docs-dualrole-instanceof-caveat
Jun 29, 2026
+21
−16
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 The new claims that the returned object "still carries both" cache fields, that "the wire parse defaults absent or malformed hints to 0/'private'", and that they are "read by the client's response-cache layer" only hold for the DiscoverResult populated by the connect-time version-negotiation probe — the public client.discover() path (which equally backs getDiscoverResult()) goes through codec.decodeResult(), which returns the raw object un-defaulted, and the response-cache layer never reads server/discover hints at all. Consider scoping the runtime-presence/defaulting claims to the probe-populated result and dropping or correcting the response-cache-layer clause.
Extended reasoning...
What the passage claims vs. what the code does
The rewritten bullet (docs/migration/support-2026-07-28.md:305-311) makes three runtime claims about the object behind
getDiscoverResult():ttlMs/cacheScope"are read by the client's response-cache layer";0/'private', so only tooling that must distinguish an omitted hint from an advertised default needs raw frames."Claims (2) and (3) are accurate only for one of the two sources of
_discoverResult, and claim (1) is not backed by the implementation.The probe path (where the claims hold). During connect-time version negotiation,
probeClassifier.ts:143routes the probe answer throughcodecForVersion(MODERN_WIRE_REVISION).validateResult('server/discover', ...).validateResultistriState()(core-internal/src/wire/rev2026-07-28/codec.ts:62-66), which returnsparsed.datafrom the dispatch schema — and that schema'sttlMs/cacheScopecarry.catch(0)/.catch('private')(rev2026-07-28/schemas.ts~1119-1128). The parsed, defaults-applied object is whatclient.ts:1093stores as_discoverResult. For this source, "still carries both" and "defaults absent or malformed hints" are true.The discover() path (where they don't).
client.discover()(client.ts:1447-1450) also populates_discoverResultand is one of the documented sources ofgetDiscoverResult(). It goes through_requestWithSchema→_requestWithSchemaViaCodec→codec.decodeResult(), which onlysafeParses the catch-defaulted wire schema as a validity check and then returns{...raw}with justresultTypedeleted (rev2026-07-28/codec.ts:247-261) — the defaulted parse output is discarded. The result is then validated against the publicDiscoverResultSchema(types/schemas.ts:577), alooseObjectwith no cache fields, which neither adds absent keys nor normalizes malformed ones.Step-by-step proof (discover() against a server that omits the hints):
server/discoverwith a result that omitsttlMsandcacheScope.codec.decodeResult('server/discover', raw)safeParses the wire schema (the.catchdefaults exist only inside that throwaway parse), then returns the raw object minusresultType— still with nottlMs/cacheScope.DiscoverResultSchemapasses it through unchanged;_discoverResultis set to it.getDiscoverResult()to readttlMs/cacheScopegetsundefined, not the documented0/'private'. Likewise a malformed hint (e.g.ttlMs: "soon") passes through verbatim instead of being defaulted.The response-cache clause. The "read by the client's response-cache layer" wording (carried over from the pre-PR text) is also not what the code does: the only freshness reads are the list verbs' aggregate write and
resources/read(client.ts:1654,1672-1680,1789-1794), each reading hints off its own result body via_freshness().'server/discover'appears inresponseCache.tsonly inside theCAP_EXEMPT_METHODSset (lines 142-148); there is no cache write or read for it anywhere in the client, so its hints are never consumed by that layer.Why this matters here. This PR's stated purpose is aligning these exact sentences with the implementation, with file:line verification, and the audience the sentence addresses is precisely the tooling that would rely on the cast/defaulting behavior. No verifier disputed the finding (4/4 confirmed).
Suggested fix. Scope the runtime-presence and 0/'private'-defaulting claims to the connect-probe-populated
DiscoverResult(or describe thediscover()behavior: omitted hints stay omitted, malformed hints pass through verbatim), and drop or correct the "read by the client's response-cache layer" clause — e.g. "appear in the response-cache store only as a cap-exempt method; the cache reads hints off the cacheable list/read results, not server/discover".