Repository navigation
server tests: the comment path stores first and strict moderation hides a pending statement - #3156
Merged
Merged
Conversation
…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
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.
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