Skip to content

🐛 Bug Report: Bulk operations in a transaction trigger no events #14219

Closed

Description

@JoshiJoshiJoshi

👟 Reproduction steps

  1. Webhook (or function) on databases.{db}.tables.{table}.rows.*.
  2. Outside a transaction: createRows (3 rows), updateRows, upsertRows, deleteRows on them.
  3. Inside transactions: the same as staged bulkCreate, bulkUpdate, bulkUpsert, bulkDelete operations, each committed (200).
  4. Inside a transaction: create + update of one row (control).

👍 Expected behavior

Every changed row emits its create/update/upsert/delete event, whether the change was made directly or through a transaction.

👎 Actual Behavior

Write path Events received
createRows / updateRows / upsertRows / deleteRows (3 rows each) 3 × create, 3 × update, 3 × upsert, 3 × delete
transaction bulkCreate / bulkUpdate / bulkUpsert / bulkDelete (3 rows each) none
transaction create + update create, update

Two runs, identical results; all commits returned 200. Webhooks, functions and realtime subscribers never see rows that are created, changed or deleted by bulk operations inside a transaction. A system that keeps a search index, cache or audit log in sync via events silently diverges.

Cause: in the post-commit event loop of Transactions/Update.php L429–L474 the bulkCreate, bulkUpdate, bulkUpsert and bulkDelete cases only break, so $documentsToTrigger stays empty and nothing is queued. main has the same code. The documents are available while the operations are applied (onNext callbacks of the bulk handlers), so they could be collected there.

🎲 Appwrite version

2.3.0

💻 Operating system

Linux (Debian 12), Docker

🧱 Your Environment

Self-hosted Appwrite 2.3.0, Postgres adapter, two API nodes, webhooks worker restarted before the test.

💡 Suggested fix

Collect the affected documents in the bulk handlers (they already receive them in onNext) and emit one event per row after the commit, like the non-transactional bulk endpoints do. If this is intentional, document that bulk operations in transactions do not trigger events.

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find a similar issue

🏢 Have you read the Code of Conduct?

  • I have read the Code of Conduct

Activity

  1. added
    api / realtime
    product / databases
    product / functions
    product / sites
    on Oct 7, 2026
  2. Prakhar0136 commented on Oct 8, 2026

    @Prakhar0136

    Hi! I’d like to work on this issue. I’ve been looking into the transaction bulk operation flow and the missing events, and I’d like to try fixing it if it’s still available. Would it be okay if I take this one?

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

    api / realtimeproduct / databasesproduct / functionsproduct / sites

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions