Skip to content

[stable33] fix(cron): stop attachment cleanup from failing on every run - #9517

Open
silverkszlo wants to merge 1 commit into
stable33from
fix/cleanup-job-unused-attachments
Open

silverkszlo wants to merge 1 commit into
stable33from
fix/cleanup-job-unused-attachments

Conversation

@silverkszlo

@silverkszlo silverkszlo commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

📝 Summary

The bug

The cleanup job resets documents without an active session before it cleans up their attachments. Documents with unsaved changes are not reset and stay in the table, but their attachments were still cleaned up. As a result, these documents are processed again on every run. If deleting an unused attachment is not permitted (e.g. a team folder without delete permission or a read-only storage), the NotPermittedException aborted the job every 5 minutes and skipped the remaining cleanup steps.

The fix

Skip documents with unsaved changes, as the saved file may not yet reference attachments that are only used in unsaved steps. For saved documents, log a warning instead of aborting the job.

Unlike main, stable33 does not need the last_attachment_cleanup column from #9166, because the reset already removes processed documents.

On main this is fixed by #9166 and #9514. For stable35 and stable34, #9166 is backported together with the fix from #9514 (#9515, #9516).

🏁 Checklist

  • Code is properly formatted (npm run lint / npm run stylelint / composer run cs:check)
  • Sign-off message is added to all commits
  • Tests (unit, integration and/or end-to-end) passing and the changes are covered with tests
  • Documentation (README or documentation) has been updated or is not required

🤖 AI

  • The content of this PR was partly or fully generated using AI tools
  • The AI-generated content was reviewed, comprehended and tested by a human

Signed-off-by: silver <s.szmajduch@posteo.de>
Assisted-by: ClaudeCode:claude-opus-5.5
@silverkszlo silverkszlo added the AI assisted This PR contains AI-assisted commits label Nov 3, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI assisted This PR contains AI-assisted commits

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants