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
Owner

Since #500, a spam-training sample's hold on a message's blob ends with the account's own copy of the message: samples::release() clears the sample's temporary blob 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, after the account was deleted too.

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.

Found by the system suite's account purge test ("Store is not empty": a leftover SpamTrainingSample), which has failed on main since #500, so the steps after it haven't run. With this change the whole system suite passes (run on a4723c51 plus this commit; on newer main it stops earlier, at the multi-tenancy check tenant.rs:1340, which isn't this change).

Since #500, a spam-training sample's hold on a message's blob ends with the account's own copy of the message: `samples::release()` clears the sample's temporary blob 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, after the account was deleted too. `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. Found by the system suite's account purge test ("Store is not empty": a leftover SpamTrainingSample), which has failed on main since #500, so the steps after it haven't run. With this change the whole system suite passes (run on a4723c51 plus this commit; on newer main it stops earlier, at the multi-tenancy check `tenant.rs:1340`, which isn't this change).
jcoffey-dev added 1 commit 2026-11-20 20:38:27 +00:00
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
d80da2fde2
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).
jcoffey-dev merged commit 177eb4e749 into main 2026-11-20 20:47:02 +00:00
jcoffey-dev deleted branch fix/spam-sample-release 2026-11-20 20:47:02 +00:00
Sign in to join this conversation.