Repository navigation
Scope transactions to the API they were created from - #14350
Conversation
Record the creating API family on the transaction document and filter list, get, update, delete, and operations by that family. Existing transactions without a type stay on the legacy / TablesDB family. Co-authored-by: Jake Barnby <[email protected]>
Security rulesNo new WARNING or ERROR findings from security rules. 19 existing findings tracked in
|
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
V25 now guards the transactions iterator so a partial project fixture or an older install without that collection can still finish migrateCollections. Co-authored-by: Jake Barnby <[email protected]>
Port the transactions type attribute and _key_type index onto main's Attribute and Index schema builders. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…kfill Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Review complete. 🟡 1 medium 💬 Inline comments (1)
🧹 Nitpicks (1) — 🟢 1 low
Every transaction endpoint now scopes reads to its database family: a shared helper in
Reviewed commit: 19f8a8c |
🟢 Tier S · Ready to mergeTransactions now record the API family that created them, and transaction routes plus staged document/row operations enforce that family boundary while allowing legacy and TablesDB to share transactions. The migration adds the schema and index, backfills older records as legacy, and the PR adds E2E and migration coverage.
📂 Walkthrough · 7
Reviewed |
There was a problem hiding this comment.
This PR adds a type discriminator (Databases vs TablesDB vs VectorsDB) to the transactions collection with family-scoped filters on all transactions endpoints, plus a V25 migration that adds the attribute/index and backfills legacy rows.
Key findings
- 🟡 List filter hides transactions whose
typeis still NULL — XList.php:69
Co-authored-by: Jake Barnby <[email protected]>
Co-authored-by: Jake Barnby <[email protected]>
|
@hansi-codes review |
Co-authored-by: Jake Barnby <[email protected]>
|
@hansi-codes review |
Co-authored-by: Jake Barnby <[email protected]>
|
@hansi-codes review |
Co-authored-by: Jake Barnby <[email protected]>
|
@hansi-codes review |
Co-authored-by: Jake Barnby <[email protected]>
|
@hansi-codes review |
List and get only need the transaction type to decide whether the id belongs to this API. Loading it under the caller roles turned another user's in-family id into not-found on list. Co-authored-by: Jake Barnby <[email protected]>
|
@hansi-codes review |
Keys still load the transaction without document ACL so a foreign-family id is not-found. A session that cannot read the transaction is left to the existing empty-list path. Co-authored-by: Jake Barnby <[email protected]>
|
@hansi-codes review |
Each page loads only the remaining untyped rows, so an update that sets type does not skip later rows the way an offset walk would. Co-authored-by: Jake Barnby <[email protected]>
|
@hansi-codes review |
…iled page Advance with cursorAfter so a page of failed updates still continues through the remaining untyped rows. Co-authored-by: Jake Barnby <[email protected]>
|
@hansi-codes review |
Co-authored-by: Jake Barnby <[email protected]>
|
@hansi-codes review |
What does this PR do?
Transaction list, get, update, delete, and operations used the shared
transactionscollection with no record of which API created the document. A transaction created through TablesDB (or the legacy Databases / DocumentsDB APIs) could be listed, fetched, committed, rolled back, or given operations through the VectorsDB routes, and the other way around.This change records the creating API family on each transaction and filters every later route by the family of the path that was called.
typeattribute on thetransactionscollection (legacy,tablesdb,documentsdb,vectorsdb), set at create time from the calling route.Existing transactions without a type
Transactions created before this attribute existed have no stored type. They are treated as the legacy family:
legacy.typevalues tolegacy.legacy.That means existing in-flight transactions stay visible and usable on
/v1/databases/transactionsand/v1/tablesdb/transactions. They are not returned or resolved on DocumentsDB or VectorsDB.typeis an internal collection field and is not added to the public Transaction response model.Test Plan
TransactionsFamilyCustomServerTest: a transaction created through one family is not listed, gettable, updatable, deletable, or writable via operations on another family (except legacy ↔ TablesDB, which share a family). Same-family list/get/update/delete still succeed.Related PRs and Issues
Checklist