Skip to content

Wire up mark_as_cancelled function in trigger cancellation flow #465

@coderabbitai

Description

@coderabbitai

Description

The mark_as_cancelled function was implemented in PR #464 to apply TTL cleanup logic for CANCELLED triggers, but it is not currently invoked anywhere in the production codebase.

Task

Either:

  • Wire the function into the cancellation pathway where triggers are currently being cancelled
  • Or remove the function if TTL behavior for CANCELLED triggers is not needed

Details

The function is located in state-manager/app/tasks/trigger_cron.py (lines 48-57) and correctly sets:

  • trigger_status to TriggerStatusEnum.CANCELLED
  • expires_at for TTL-based cleanup

To fix, locate where triggers are currently cancelled and replace direct status updates with a call to mark_as_cancelled(trigger, retention_days), ensuring retention_days is sourced from config.

Context

Related PR: #464
Original discussion: #464 (comment)

Requested by: @spa-raj

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