Skip to content

DB create events sending back $collectionId instead of $databaseId #12418

Closed

Description

@JoshLee0915

👟 Reproduction steps

  1. Create a new DB and table
  2. Setup a function that triggers on row create
  3. Have function dump out the event body sent to the function

👍 Expected behavior

Expect to see a row object as defined in the row documentation:
https://appwrite.io/docs/references/cloud/models/row

👎 Actual Behavior

A row object is returned but is missing $databaseId and instead has the old $collectionId property

🎲 Appwrite version

Different version (specify in environment)

💻 Operating system

Windows

🧱 Your Environment

  • appwrite: 1.9.0 self hosted on local PC through docker
  • appwriteSDK: sdk-for-go v4.0.0

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

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

Activity

  1. added theissue type on May 28, 2026
  2. added
    product / databases
    product / functions
    product / self-hosted
    on May 28, 2026
  3. vaguul commented on Jun 1, 2026

    @vaguul

    Not a maintainer, but this may be coming from a compatibility boundary between the new TablesDB route/model and the legacy document/collection path.

    For row creation, src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Create.php extends the document-create route, but the route itself is already TablesDB-shaped: /v1/tablesdb/:databaseId/tables/:tableId/rows, audit event row.create, audit resource database/{request.databaseId}/table/{request.tableId}, and response model MODEL_ROW.

    If the realtime/event serialization still reuses the older document payload shape, it could explain why $collectionId leaks through even though the TablesDB route receives databaseId and tableId. It would help to compare the emitted event payload against the Row response model and check whether $tableId is missing entirely or whether $collectionId is being used as a backwards-compatible alias.

  4. iakshkhurana commented on Oct 1, 2026

    @iakshkhurana

    Hi, I'd like to work on this. Could I be assigned?

    Plan: reproduce on the latest version with a function triggered on a TablesDB row create event and compare the event payload with the documented Row model. If the event still goes through the legacy document model, I'll make the TablesDB row events serialize the payload with MODEL_ROW, so it has $tableId and $databaseId instead of $collectionId. The legacy Collections API payload stays as it is. I'll add an e2e test that checks the payload keys of a row create event.

  5. HarshMN2345 commented on Oct 8, 2026

    @HarshMN2345
    Member

    Row create events now carry $databaseId and $tableId on every path: single create, bulk create and transaction commit. The commit path was the one missing $databaseId; #13535 fixed it, and that fix shipped in 2.1.0. #14216 also removes the internal $collection field from commit and bulk event payloads.

    Please reopen if you still see $collectionId on a TablesDB row event on 2.1.0 or later.

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

    product / databasesproduct / functionsproduct / self-hosted

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions