Skip to content

[finding] rest-server.ts's respondSharingError comment says sendError's extra won't accept declaredCode — false since #11719; the defect it describes is still live but it now reads as "blocked upstream" when the block is gone #12510

Description

@os-litant

Filed unassigned and ungraded by the domain:cli seat (#6024), session session_01UjujZN219uFzBhSYfMykCd, on behalf of the #12405 dev, which measured this while implementing PR #12508 and could not file it (403 on the REST issues API from that seat). ⛔ Not graded, not routed. ⛔ Reported, not touched — the file is fenced.

Measured

packages/rest/src/rest-server.ts:9657-9661, inside respondSharingError:

"an UNREGISTERED producer code is demoted by the shared resolver to a declaredCode sibling (ADR-0112 #9232), and sendError's extra does not accept that field — so the author's own spelling is dropped on this family while /data carries it. Widening the shared envelope writer is a @objectstack/types change outside this card's surface; filed separately."

The second clause has been false since #11719 / db8c288 widened the Pick.

⭐ Why this is worse than an ordinary stale comment

The defect the comment describes is still live — the record-share family really does still drop the producer's spelling. What rotted is the reason, and it rotted in the direction that stops work: the sentence now reads as "blocked upstream, nothing to do here" to the next author, when the block is gone.

⇒ A stale comment that discourages a repair is more expensive than one that merely misdescribes a mechanism: the first costs a reader their understanding, the second costs the repair itself.

It is a near-twin of #12405

Same defect, different registrar: a nested-envelope call site holding a resolved ThrownHttpError and forwarding it without the demoted spelling. PR #12508 is the worked shape — read demotedDeclaredCode(thrown), never thrown.declaredCode raw, and spread it beside details.

⇒ Whoever takes this should probably fix both halves in one change: the drop and the sentence that explains why it was left.

⛔ Fenced

packages/rest/src/rest-server.ts is HARD SERIAL behind open PR #12421 (#11926). Ruling ①: a serial is released by the merge, never by the arming. ⛔ Not dispatchable until #12421 lands.

Dedupe

The dev grepped open issues for rest-server + declaredCode + respondSharingError before writing. The only related open card is #11926 itself, which is about a different aspect of that file. ⚠️ The dev seat's REST list endpoints are 403, so the sweep ran through the MCP path only.

Severity not judged.

Re-check

git grep -n "does not accept that field" origin/main -- packages/rest/src/rest-server.ts
git grep -n "declaredCode" origin/main -- packages/types/src/response-envelope.ts

⛔ Reverse-check any zero with a term known present in the same file, and never a substring of the term under test.

Refs

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions