Repository navigation
fix(databases): emit surface-correct ids in committed transaction events - #13535
Merged
Merged
Conversation
The commit handler is the only place that builds a row or document event payload by hand instead of going through processDocument(). It never added the synthetic $databaseId, which does not exist on a stored document, and wrote both $tableId and $collectionId unconditionally. So a function or webhook triggered by a committed transaction received a row without $databaseId and carrying the legacy $collectionId, contradicting the Row model. All four surfaces were affected, since the TablesDB, DocumentsDB and VectorsDB transaction actions extend this one. Add $databaseId and derive the container key from the group id already resolved in the same loop, matching processDocument().
Contributor
Greptile SummaryThis PR corrects committed transaction event payloads so they expose identifiers appropriate to the originating database API surface.
Confidence Score: 5/5The PR appears safe to merge; no actionable regressions or outstanding rule violations were identified. The transaction commit path now supplies the database identifier and exactly one surface-specific container identifier, while the shared test verifies the resulting project webhook payload across the supported API families. Important Files Changed
Reviews (2): Last reviewed commit: "test(databases): use project webhook pol..." | Re-trigger Greptile |
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
ArnabChatterjee20k
approved these changes
Sep 8, 2026
2 of 4 tasks
This was referenced Sep 22, 2026
2 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to #12418.
What does this PR do?
Adds
$databaseIdand the appropriate$tableIdor$collectionIdto document and row events emitted when committing a transaction. The handler previously omitted the database ID and added both container keys.The identifiers come from the database and collection resolved for each operation, matching normal document processing. This fixes the transaction path; it does not establish that the ordinary-create scenario in #12418 is resolved.
Test Plan
testCommitEventPayloadCarriesSurfaceIdsstages and commits a record through the API, then usesgetLastRequestForProject()with the unique record ID to find its webhook. It checks the database ID, the correct container ID and absence of the opposite container key.The test uses the existing shared transaction suite. Pint and PHP syntax checks passed; the updated E2E runs in CI.