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
fix(runtime): a repeated ?version= on GET /packages/:id answers 400 VALIDATION_ERROR from the one shared rule (#17672)
The door refused a repeated `?version=` with `404` and a sentence of its own,
so a request-shape error was indistinguishable from the two genuine not-founds
the same door answers. The repo's one rule for this condition already answers
`400 VALIDATION_ERROR` in the ADR-0112 nested body; what blocked #17668 from
calling it was that `packages/rest/src/query-multiplicity.ts` is reachable from
nowhere outside its package.
- `@objectstack/rest`'s barrel publishes `repeatedQueryParamMessage` and
`refuseRepeatedQueryParams`, with the entry recording which half is portable
across a package boundary and which is not.
- The dispatcher's `/packages` domain calls the message function and drops its
local copy; `deps.error(msg, 400)` derives `VALIDATION_ERROR`.
- The module header's "and it reads no `version`" parenthetical is corrected —
false since #17668 landed, and load-bearing prose about why the rule has one
home.
- `packages-get-version-scope.test.ts` §4's pin is deliberately changed from
the interim `404` to the end state, and §5 pins the distinction the card is
about.
Claude-Session: https://claude.ai/code/session_01TSf4DV7ziu4V5j73e46b7c
Co-authored-by: Claude <noreply@anthropic.com>
fix(runtime): a repeated `?version=` on `GET /packages/:id` is refused `400 VALIDATION_ERROR` in the repo's one message, and `@objectstack/rest` publishes the rule that owns it (#17672)
7
+
8
+
`GET /api/v1/packages/:id?version=a&version=b` answered **`404`**, with a second
9
+
sentence written at that door. This repo already had a landed answer for exactly
10
+
that condition on exactly that route — `400 VALIDATION_ERROR` in the ADR-0112
11
+
nested body (#6307) — and one implementation of it, `refuseRepeatedQueryParams`
12
+
/ `repeatedQueryParamMessage` in `packages/rest/src/query-multiplicity.ts`,
13
+
whose header is the authority on the rule.
14
+
15
+
Driven before the change, one host, three refusals:
16
+
17
+
```
18
+
GET /packages/com.acme.crm?version=a&version=b -> 404 RESOURCE_NOT_FOUND
19
+
GET /packages/com.acme.crm?version=99.0.0 -> 404 RESOURCE_NOT_FOUND
20
+
GET /packages/com.absent.pkg?version=99.0.0 -> 404 RESOURCE_NOT_FOUND
21
+
```
22
+
23
+
A client branching on the answer could not tell "your request named the
24
+
parameter twice" from the two genuine not-founds. After:
25
+
26
+
```
27
+
GET /packages/com.acme.crm?version=a&version=b -> 400 VALIDATION_ERROR
28
+
GET /packages/com.acme.crm?version=99.0.0 -> 404 RESOURCE_NOT_FOUND
29
+
GET /packages/com.absent.pkg?version=99.0.0 -> 404 RESOURCE_NOT_FOUND
0 commit comments