fix(item): deleting a job frees its unclaimed rewards #185
No reviewers
Labels
No labels
adr
android
area/calendar
area/design-system
area/i18n
area/jobs
area/offline
area/server
area/testing
bug
ci
duplicate
enhancement
help wanted
invalid
notifications
question
reliability
security
severity/low
severity/medium
tracking
web
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
eagraiclainne/app!185
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/delete-frees-unclaimed-rewards"
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?
Deleting a job left every unclaimed reward linked to it pointing at a row
that no longer exists. Every eligibility filter — client and server — skips a
reward that already has an item, so the reward was not returned to the pool.
It was destroyed, with no message and no way back.
Unlinking now runs inside the delete transaction, over the job and over each
cascaded sub-job, on the same locked-read then write path the completion
auto-claim uses. A claimed reward keeps its link: it is settled ledger
history, the points are already banked to whoever earned them, and ADR-0015
refuses to relink one anyway. Banked points are untouched either way.
The live data feed hears about the freed rows after the commit, since they
move without the
svcseams.Why now
This is the one server change the jobs flow redesign needs (#184, step 0). The
delete dialog tells the household "the 22 points reward goes back to the
rewards list" — that sentence is only true after this lands, so #176 depends
on it.
Verification
item_integration_test.go: unclaimed rewards on thejob and on a sub-job come back unlinked and relink to another job with no
unlink first; a banked reward keeps its link, its claim and its value.
make checkandmake test-integrationboth green.One thing the specs surfaced and now record:
Claimrefuses a linked rewardoutright ("this reward is earned by completing its linked job"), so completion
is the only door to the banked state.
Closes nothing on its own — see #184 for the flow this unblocks.
🤖 Generated with Claude Code
Test report
Coverage: 26.7%
Updated by the check workflow · commit
7ca62a0a2ba7819ecbcd3a0abc339a3a0abc339a7ca62a0a2b