Skip to content

Migrations: a downgrade leaves the removed feature's recurring job pending (webhook_prune after 0015 down) #800

Backlog

Description

@ephico2real2

Part of #783. Found by reviewer 1 (Codex) on PR #791, confirmed by reading by reviewer 2 (Fable); not run.

What is wrong. 0015_webhook_deliveries downgrade drops the table, but the pending webhook_prune job stays in jobs. An older worker claims it, has no handler, and retries it until MAX_ATTEMPTS (cmapi/src/cmapi/worker.py:145-174). No migration deletes a job on downgrade, so this is the codebase's pattern, not only 0015's. It touches no request.

How to prove it. A migration test seeds the job, downgrades to 0014, and runs one worker claim of the old code: today it logs an unknown-handler failure; after the fix no such job remains.

Research mandate. Quote Alembic's guidance on data in downgrades and decide one rule for recurring jobs that a migration introduces.

Activity

  1. added
    bug
    sev:low
    Backlog
    on Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Backlogbugsev:low

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions