Repository navigation
Description
Goal
Prevent locally owned PostgreSQL push notification configs from surviving an administrative task-table reset performed with TRUNCATE.
Problem
The current task-aware-push-config-v3 schema removes the legacy push-to-task foreign key and relies on task-table triggers for local push-config lifecycle coordination:
- a
BEFORE DELETEtrigger acquires the exclusive advisory lock used to coordinate task deletion with local push creation; - an
AFTER DELETE ... FOR EACH ROWtrigger removes push-config rows wherelocal_postgres_task = TRUE.
PostgreSQL does not fire row-level DELETE triggers for TRUNCATE.
Therefore, an operator who directly executes TRUNCATE on a2a_tasks can bypass both row-level delete-trigger paths and leave locally owned push configs behind. If the same task ID is created again later, stale callback configuration could become associated with the reused ID.
This remains an out-of-band administrative mutation rather than a normal SDK task-store operation, but the maintenance/reset contract should be hardened or explicitly constrained.
Scope
Evaluate and implement one of:
- an
AFTER TRUNCATEcleanup mechanism that removes locally owned push configs; or - an explicit unsupported-operation contract documenting that direct task-table
TRUNCATEmust not be used, together with a safe administrative reset procedure.
If implementing database-side cleanup:
- preserve externally owned rows where
local_postgres_task = FALSE; - update auto-created schema/migration logic;
- extend externally managed schema validation;
- update migration/storage documentation;
- add deterministic PostgreSQL conformance coverage for truncate behavior;
- avoid adding work to normal create/get/list/delete hot paths.
If choosing a documentation-only contract:
- clearly document that direct
TRUNCATE a2a_tasksis unsupported; - provide a safe reset procedure that cannot leave local push configs behind;
- document the behavior for externally owned push configs.
Acceptance criteria
- Administrative task-table reset cannot silently leave locally owned push configs that may later become active for a reused task ID, or direct
TRUNCATEis explicitly unsupported with a documented safe alternative. - External-authority push configs are preserved where appropriate.
- Existing normal task deletion behavior remains unchanged.
- Advisory-lock coordination for normal DELETE-based task removal remains unchanged.
- No additional work is added to normal request hot paths.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
[-]Handle PostgreSQL task-table TRUNCATE with local push configs[/-][+][Task:Handle PostgreSQL task-table TRUNCATE with local push configs[/+][-][Task:Handle PostgreSQL task-table TRUNCATE with local push configs[/-][+][Task]: Handle PostgreSQL task-table TRUNCATE with local push configs[/+]