Skip to content

[BUG] Retention does not delete stored checkpoint or queue entries #50

Closed

Description

@Nitjsefnie

Bug Description

IncidentStore.apply_retention() leaves checkpoint and queue entries created through the repository's storage-key helpers untouched. Calling retention for an organization returns zero deletions for those entries, and both remain stored; dated audit and log entries are deleted by the same call.

Steps to Reproduce

  1. Create an IncidentStore backed by MemoryStorage.
  2. Store one checkpoint entry using checkpoint_key() and one pending queue entry using queue_key() for the same organization.
  3. Call apply_retention() for that organization with retention enabled.
  4. Observe that the deletion count is zero and both entries remain present.

Expected Behavior

Checkpoint and queue entries covered by the retention policy are deleted once they are older than the configured retention period.

Actual Behavior

Checkpoint and queue entries created with the production key shapes are never deleted by apply_retention().

Environment

  • OS: GitHub Actions Ubuntu runner
  • Python Version: 3.10, 3.11, and 3.12
  • Agent Version/Commit: 2e6bcf00d0b15e478fa9a8b90402452111852124
  • Deployment Method: Unit test with MemoryStorage
  • Platform: GitHub Actions

Configuration

AUDIT_RETENTION_DAYS=90

Logs

deleted == 0
checkpoint key remains present
queue key remains present

Additional Context

Discovered during independent verification of issue #8's retention-scheduling work. A runner-backed characterization reproduced the behavior on the default-branch implementation and on the scheduling candidate without modifying the retention helper.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions