Skip to content

Rename transaction methods to Tx suffix - #12

Merged
0x80 merged 1 commit into
mainfrom
thijs/0220-rename-transaction-methods
Feb 20, 2026
Merged

Rename transaction methods to Tx suffix#12
0x80 merged 1 commit into
mainfrom
thijs/0220-rename-transaction-methods

Conversation

@0x80

@0x80 0x80 commented Feb 20, 2026

Copy link
Copy Markdown
Owner

Rename InTransaction/FromTransaction naming to the Tx suffix convention used by @typed-firestore/server. The Tx suffix goes at the end, with Maybe before it (e.g. getDocumentMaybeTx).

Fixes two bugs:

  • getDocumentTx and getDocumentMaybeTx were using makeMutableDocument instead of makeMutableDocumentTx, so mutations bypassed the transaction.
  • getSpecificDocumentTx was returning an immutable FsDocument instead of a mutable FsMutableDocumentTx.

Deprecated re-exports are provided for all old names to maintain backward compatibility.

Align naming with @typed-firestore/server by using the Tx suffix
convention. Fix getDocumentTx and getDocumentMaybeTx to use
transaction-bound mutations instead of standalone ones. Fix
getSpecificDocumentTx to return a mutable document instead of an
immutable one. Deprecated re-exports are added for backward
compatibility.
Copilot AI review requested due to automatic review settings February 20, 2026 17:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the library’s public API naming to use a Tx suffix for transaction-aware helpers (matching the @typed-firestore/server convention) and fixes transaction mutation behavior to correctly bind updates/deletes to the provided Firestore transaction.

Changes:

  • Renames transaction variants to *Tx (with Maybe before Tx) and adds deprecated aliases for prior names.
  • Fixes transaction helpers to use makeMutableDocumentTx so mutations don’t bypass the transaction.
  • Ensures getSpecificDocumentTx returns a mutable transaction document type and updates docs accordingly.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/types.ts Introduces FsMutableDocumentTx and deprecates FsMutableDocumentInTransaction alias.
src/make-mutable-document.ts Adds makeMutableDocumentTx, deprecates makeMutableDocumentInTransaction.
src/get-specific-document.ts Renames transaction accessor to getSpecificDocumentTx and returns a mutable Tx document.
src/get-document.ts Renames transaction accessors to getDocumentTx / getDocumentMaybeTx and binds mutations to Tx.
README.md Updates documented function list to reflect new *Tx naming.
CLAUDE.md Updates type naming reference for transaction variant.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/types.ts
@0x80
0x80 merged commit 3341101 into main Feb 20, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants