Skip to content

fix: show a commit as checked only while an AI check is queued - #516

Open
SanderMuller wants to merge 1 commit into
dev-null-sh:productionfrom
SanderMuller:fix/ai-check-queued-marker
Open

SanderMuller wants to merge 1 commit into
dev-null-sh:productionfrom
SanderMuller:fix/ai-check-queued-marker

Conversation

@SanderMuller

Copy link
Copy Markdown
Contributor

A pending commit counted as "being checked" whenever it had no AI decision yet and was less than 15 minutes old. Nothing checked that a check was actually queued. A reputable author with a recent report gets a pending commit, but CreateCommit skips ModerateCommit for reputable authors. So for 15 minutes the author saw "checking", and the client kept polling commits/{commit}/status, for a check that never runs. The job's early returns left the same state behind.

Now the check leaves a marker:

  • CreateCommit writes ai_decision = pending exactly when it dispatches ModerateCommit.
  • isBeingChecked() looks for that marker. The 15-minute limit stays, for a job that is lost.
  • ModerateCommit clears the marker on both early returns and in a new failed(). It clears it only while it is still pending, so a verdict written in the meantime stays.

ai_decision stays hidden outside moderation. The moderation page still shows "No AI decision yet" for a queued commit, and its TS type now allows pending. No migration: the column is a string cast to CommitStatus, which already has pending. A commit that was queued before the deploy has no marker, so it stops showing "checking" early.

Several of the changed cases in CreateCommitTest, ModerateCommitTest and CommitStatusControllerTest fail on production. That includes the reputable author with a report, who got isBeingChecked() === true.

#104 also changes CreateCommit.php, Commit.php and types/commit.ts, in other lines, so one of the two may need a small rebase.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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