Skip to content

v0.8.3 — data-loss hotfix: document files

Choose a tag to compare

@xiao-villamor xiao-villamor released this 09 Jul 14:36
a9d7368

Upgrade immediately if you use Documents.

Fixed

  • Hourly cleanup could delete document files. The background job that removes unreferenced files only recognised model files as "in use", so uploaded documents (PDFs and other binaries) were treated as leftovers and deleted. Only local storage was affected; S3/R2 installs were not.

    Documents deleted by an earlier version cannot be recovered by upgrading — restore them from a backup taken before the loss, if you have one.

  • Backups omitted document files. For the same reason, document blobs were never written into the backup archive, so restoring a backup silently lost them. New backups include them.

  • S3/R2 existence checks hid errors. A credentials or permissions failure was reported as "this file does not exist" instead of raising. Combined with the cleanup job, a transient auth error could have been read as "every file is unreferenced".

Under the hood

The cleanup sweep and the backup manifest each answered "which files does the database still own?" separately, and only one of them knew about documents. Both now share a single census (all_owned_blob_keys), so they cannot disagree again. Regression tests cover a document surviving a cleanup cycle, a trashed model keeping its bytes until it is purged, genuine leftovers still being collected, and a document round-tripping through backup and restore.

Full changelog: https://github.com/xiao-villamor/PrintStash/blob/main/CHANGELOG.md