Spam samples: ending a hold early removes the sample too #510

Merged
jcoffey-dev merged 1 commits from fix/spam-sample-release into main 2026-11-20 20:47:02 +00:00
1 Commits
Author SHA1 Message Date
jcoffey-dev d80da2fde2 Spam samples: ending a hold early removes the sample too (UD-14a)
ci / fork-checks (pull_request) Skipped
ci / build (pull_request) Skipped
github/ci (branch) GitHub Actions
ci / github (pull_request) Successful in 8m25s
Since #500, a spam-training sample's hold on a message's blob ends with
the account's own copy: release() clears the sample's temporary link.
The blob purge is what removes a SpamTrainingSample, and it finds one
only through that link's value once the link expires. With the link
cleared early, nothing found the sample again, so its registry item and
account index stayed behind for good, past the account's deletion.

release() now reads the sample's id from the link before clearing it,
and removes the registry item and its index in the same write.

The system suite's account purge test caught it ("Store is not empty":
a leftover SpamTrainingSample).
2026-11-20 13:15:26 -07:00