The daily scan keeps one baseline per stored file and reports every baseline
whose file is gone as a StorageBleed. Nothing ever removed a baseline, so
every attachment purged by retention and every avatar deleted was reported
missing on every run from then on - one finding folded 1,164 times.
The baseline is now forgotten where WeKan deletes or moves a local file:
- Attachments and Avatars onAfterRemove, for every version path. This is
the retention purge's path: Meteor-Files unlinks the version paths itself
after that hook, without going through the store strategy, so a fix in
the strategy's unlink() alone would not have covered it;
- the filesystem strategy's unlink() (moving a file to GridFS or cloud);
- the filesystem strategy's rename(), for the old path.
A file that vanishes any other way keeps its baseline and is still reported.
The removal is fire-and-forget and can never break a delete.
Baselines already orphaned before this fix stay reported until removed, as
described in the issue.
Thanks to Raymond-Voogt and xet7 !
Fixes#6898.