Skip to content

server tests: the comment path stores first and strict moderation hides a pending statement - #3156

Merged
colinmegill merged 1 commit into
edgefrom
store-first-moderation
Oct 18, 2026
Merged

colinmegill merged 1 commit into
edgefrom
store-first-moderation

Conversation

@colinmegill

Copy link
Copy Markdown
Member

Tests only; no product change and no observable change.

Pins the comment path's ordering as it is on edge since PR #3074 (the LLM moderation check switched off) and PR #3081 (the client removed): the handler sets the moderation state locally, runs language detection as its only outside call (capped by TRANSLATION_TIMEOUT_MS), stores the statement, then answers; under strict moderation a pending statement is hidden on read (comment.ts), and the next-statement and statement-list reads apply the same filter. Four tests: (a) the response arrives within a bound while the outside call hangs past its cap; (b) strict mode: a stored statement is not returned by the next-statement and list reads until approved; (c) non-strict mode behaves as mapped; (d) a late result still lands. Five deliberate mutations of the handler each make a test fail.

Verified on a work box: the 20 comment and moderation suites (407 tests) and the 7 guard suites (44 tests) pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_018NVGBuYCk4EZmiz4csUv9s

…erated

POST /api/v3/comments makes no moderation call: a participant's statement
is stored with mod 0 and active true, and whether it is shown is decided
when it is read. Under strict moderation only approved statements are
shown, so a new one stays hidden from every participant, its author
included, until a moderator approves it; otherwise it is shown as soon as
it is stored and a moderator can hide it later.

The new integration test pins that ordering:
- statements answer within 8 s while the language provider hangs, and
  while they wait another participant's vote and nextComment answer
  within 3 s and before any of them, so the wait holds no connection the
  participation path needs;
- under strict moderation a statement stored with the provider failing
  is absent from the participant list, the paginated list, nextComment
  and an initial_tid link until the owner approves it;
- without strict moderation it is shown at once and disappears when the
  owner rejects it.

Each assertion fails against a mutation of the code it guards: no bound
on the provider wait, a pooled connection held across it, a slow call
before the INSERT, and either visibility filter inverted.

Observable change: none. Test only; no schema change.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018NVGBuYCk4EZmiz4csUv9s
@colinmegill
colinmegill merged commit 1eb5d29 into edge Oct 18, 2026
22 checks passed
@colinmegill
colinmegill deleted the store-first-moderation branch October 18, 2026 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant