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
Description
The
mark_as_cancelledfunction 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:
Details
The function is located in
state-manager/app/tasks/trigger_cron.py(lines 48-57) and correctly sets:trigger_statustoTriggerStatusEnum.CANCELLEDexpires_atfor TTL-based cleanupTo fix, locate where triggers are currently cancelled and replace direct status updates with a call to
mark_as_cancelled(trigger, retention_days), ensuringretention_daysis sourced from config.Context
Related PR: #464
Original discussion: #464 (comment)
Requested by: @spa-raj