Skip to content

fix(reset): drop stale processed files on the reset target - #49

Open
maikschneider wants to merge 2 commits into
mainfrom
fix/reset-stale-processedfiles
Open

fix(reset): drop stale processed files on the reset target#49
maikschneider wants to merge 2 commits into
mainfrom
fix/reset-stale-processedfiles

Conversation

@maikschneider

@maikschneider maikschneider commented Aug 9, 2026

Copy link
Copy Markdown
Member

sys_file_processedfile sits in the default ignore_tables_out of sourcebroker/deployer-typo3-database, so the dump carries no rows for it and the target keeps its own. After the import those rows point at the old originalfilesha1 while sys_file.sha1 holds the source value, so ProcessedFile::needsReprocessing() flags the record deleted and only updateWithLocalFile() would clear the flag again - which the early return in LocalImageProcessor never reaches. The frontend then dies with "File has been deleted." (1329821486).

Projects using ichhabrecht/filefill hit this hardest: filefill re-downloads the processed file inside exists(), so the delete() branch is taken and the leftover file in processed survives every reset (the rclone copy never deletes).

Run cleanup:localprocessedfiles --all after the import to drop both the records and the files.

Summary by CodeRabbit

  • Bug Fixes
    • Improved database reset reliability by reconciling processed files after imports.
    • Helps ensure file states remain consistent following a reset.

sys_file_processedfile sits in the default ignore_tables_out of
sourcebroker/deployer-typo3-database, so the dump carries no rows for it
and the target keeps its own. After the import those rows point at the
old originalfilesha1 while sys_file.sha1 holds the source value, so
ProcessedFile::needsReprocessing() flags the record deleted and only
updateWithLocalFile() would clear the flag again - which the early
return in LocalImageProcessor never reaches. The frontend then dies with
"File has been deleted." (1329821486).

Projects using ichhabrecht/filefill hit this hardest: filefill
re-downloads the processed file inside exists(), so the delete() branch
is taken and the leftover file in _processed_ survives every reset (the
rclone copy never deletes).

Run cleanup:localprocessedfiles --all after the import to drop both the
records and the files.
@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7d3cce9f-2796-4eb4-adc4-4959fb888817

📥 Commits

Reviewing files that changed from the base of the PR and between 8686895 and 3b05d5e.

📒 Files selected for processing (1)
  • reset.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • reset.yml

Walkthrough

After the database import, the reset job runs TYPO3’s cleanup:localprocessedfiles --force command. This reconciles local processed-file records after source file hashes replace target values.

Estimated code review effort: 1 (Trivial) | ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: removing stale processed files from the reset target.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/reset-stale-processedfiles

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@reset.yml`:
- Line 147: Review the reset workflow around the cleanup:localprocessedfiles
command and confirm whether the --all scope is intended. If full regeneration is
not required, replace it with a supported targeted reconciliation; otherwise
document or enforce running this destructive operation during a maintenance
window while preserving the existing target selector and non-interactive
options.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 06052c4e-248c-40ac-bad9-d893f4182452

📥 Commits

Reviewing files that changed from the base of the PR and between 8a8e730 and 8686895.

📒 Files selected for processing (1)
  • reset.yml

Comment thread reset.yml Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant