Skip to content

fix(import): avoid crash when table or view is deleted before import job runs - #2987

Open
silverkszlo wants to merge 2 commits into
mainfrom
fix/import-table-job
Open

fix(import): avoid crash when table or view is deleted before import job runs#2987
silverkszlo wants to merge 2 commits into
mainfrom
fix/import-table-job

Conversation

@silverkszlo

Copy link
Copy Markdown
Contributor

The ImportTableJob was throwing the following error multiple times:

Did expect one result but found none when executing: query
  "SELECT * FROM tables_tables WHERE id = :dcValue1"

If the table (or the view whose table this resolves) is deleted between when the import job is queued and when the background worker picks it up, TableMapper::find()/ViewMapper::find() throws DoesNotExistException, which propagates uncaught out of run().

Wrap the table/view lookup in a try/catch so a deleted table or view is logged as a warning and the import-finished activity is skipped instead of throwing.

🏁 Checklist

  • ⛑️ Tests (unit and/or integration) are included or not needed
  • 🔙 Backport requests are created or not needed: /backport to stableX.X
  • 📅 Milestone is set
  • 🌸 PR title is meaningful (if it should be in the changelog: is it meaningful to users?)

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Comment thread lib/BackgroundJob/ImportTableJob.php
…job runs

Signed-off-by: silver <s.szmajduch@posteo.de>
Assisted-by: ClaudeCode:claude-sonnet-5
Signed-off-by: silver <s.szmajduch@posteo.de>
Assisted-by:ClaudeCode:claude-opus-5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants