Repository navigation
Normalise server route handlers and reply messages - #1424
Merged
Merged
Conversation
Record the one reply text the browser matches ("Not found", used by the
lifecycle archive sync) as a frozen wire contract in
shared/src/api/replyMessages.ts, and gather every other route message in
server/src/routes/replyErrors.ts as a sentence-case sentence with a full
stop.
Route handlers now type params and query strings through Fastify route
generics instead of casts, parse bodies through ParseResult parsers, and
return every reply as reply.code(...).send(...). Replies that echoed a
thrown error's message send a fixed message instead; a rejected import
logs the parser's reason and replies with a fixed sentence.
A scoped DELETE whose accountId query repeats now gets the existing 400
instead of reaching authorization with an array.
Refs #1409
Signed-off-by: Kevinjohn Gallagher <kevinjohngallagher@hotmail.com>
Assert the lifecycle 404 body carries the frozen wire text the client matches, cover a scoped DELETE whose accountId query repeats, and rename the route-unavailable 404 message key so it cannot be mistaken for the frozen constant. Message text is unchanged. Refs #1409 Signed-off-by: Kevinjohn Gallagher <kevinjohngallagher@hotmail.com>
Signed-off-by: Kevinjohn Gallagher <kevinjohngallagher@hotmail.com>
This was referenced Oct 1, 2026
Owner
Author
|
Polish review: no P1/P2 findings.
Merge order for this batch: #1411, #1412, #1414 → #1413, #1415, #1416 → #1417 → #1418, #1419 → #1420 → #1421 → #1422 → #1423 → #1424 → #1425 → #1426. Predecessor: #1423. |
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.
Part of #1409 (T12). Merge predecessor: #1423 (this PR's base branch,
feature/test-scaffolding).shared/src/api/replyMessages.ts;src/data/sync/lifecycleOps.tsimports the constant instead of repeating the text. Every other server message lives inserver/src/routes/replyErrors.ts, in sentence case with a full stop.ParseResultparser pattern), typed route generics instead ofreq.query/req.paramscasts, and every reply returned asreturn reply.code().send().accountIdis refused with 400 and leaves the row. The missing-accountIdtest previously used a lifecycle entity and never reached that check.Wire shapes, status codes and frozen messages are unchanged; conformance pins were updated deliberately.
Validation: Integrated Batch 4 tip (all five Batch 4 branches):
pnpm run gate:allandpnpm run e2e(290 passed) on Node 24.16.0. Later changes on the stack touch only comments, the comment checker and two reference pages; on the final tip typecheck, lint, format, the comment-voice check and its test,ui:check,docs:buildandpnpm run gate:serverpass. Independently reviewed; findings applied.pnpm run test:account-conformancepasses (302 tests).Merge order
Merge predecessor for this PR: #1423.