[Backend] count_bot_proposals ignores deleted_at and over-counts against the page it describes #524
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found while building #368 (v4.3.0 phase 4).
lore_service.count_bot_proposals(around line 695) does not filterdeleted_at IS NULL, while the listing it summarises (lore_service.pyaround line 684) does. Every surface that shows the count next to a link to the review page can therefore claim more pending suggested wiki updates than the page lists, and the gap grows with every soft-deleted proposal. The newGET /api/me/attentionquery filters correctly, so the dashboard's "Needs you" number and the campaign page's count can now disagree.Fix: add the
deleted_at IS NULLpredicate to the count (and any sibling count helper), with a test that a soft-deleted proposal is excluded from both the count and the list.