Closed simonbaird closed 2 years ago
I tried to reproduce the symptom locally by disabling the purge later job, and I wasn't able to. So I think there's something else going on. What happens is (somehow) the old ActiveStorage::Attachment
record is still associated with the site, even though it should be not possible for a has_one_attachment association.
This makes me think maybe there's an error message produced when it happens.
For the order by
workaround, I think this might do it:
+ActiveStorage::Attachment.class_eval do
+ default_scope { order('created_at DESC') }
+end
But I haven't been able to confirm it yet.
(It's not the blob that needs it, as I suggested originally, it's the attachment.)
A dupe appeared, and afaict the workaround is effective. I'll close this tentatively.
Sometime the "purge_later" job fails. I don't know the reason for it, but the result is a stale leftover blob. This wouldn't be a problem, except that (it appears?) the stale blob is the one that is returned by the tiddlywiki_file assocation. This is a big problem because if the user reloads their site they get the old version, effectively losing the latest save.
Solution ideas: