Skip to content

[Task]: Handle PostgreSQL task-table TRUNCATE with local push configs #198

Closed

Description

@MisterVVP

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 DELETE trigger acquires the exclusive advisory lock used to coordinate task deletion with local push creation;
  • an AFTER DELETE ... FOR EACH ROW trigger removes push-config rows where local_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 TRUNCATE cleanup mechanism that removes locally owned push configs; or
  • an explicit unsupported-operation contract documenting that direct task-table TRUNCATE must 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_tasks is 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 TRUNCATE is 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.

Activity

  1. changed the title [-]Handle PostgreSQL task-table TRUNCATE with local push configs[/-] [+][Task:Handle PostgreSQL task-table TRUNCATE with local push configs[/+] on Aug 9, 2026
  2. changed the title [-][Task:Handle PostgreSQL task-table TRUNCATE with local push configs[/-] [+][Task]: Handle PostgreSQL task-table TRUNCATE with local push configs[/+] on Aug 9, 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

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions