From 6371d991d9564dbfc9f79353cabb72ee45797f58 Mon Sep 17 00:00:00 2001 From: Durran Jordan Date: Tue, 24 Jun 2025 14:17:47 +0200 Subject: [PATCH 1/4] chore(NODE-6865): deprecate transaction getters --- src/transactions.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/transactions.ts b/src/transactions.ts index 308d0ad90f6..0d8fdc40614 100644 --- a/src/transactions.ts +++ b/src/transactions.ts @@ -122,26 +122,33 @@ export class Transaction { return this._pinnedServer; } + /** @internal */ get recoveryToken(): Document | undefined { return this._recoveryToken; } + /** @internal */ get isPinned(): boolean { return !!this.server; } - /** @returns Whether the transaction has started */ + /** + * @internal + * @returns Whether the transaction has started + */ get isStarting(): boolean { return this.state === TxnState.STARTING_TRANSACTION; } /** + * @internal * @returns Whether this session is presently in a transaction */ get isActive(): boolean { return ACTIVE_STATES.has(this.state); } + /** @internal */ get isCommitted(): boolean { return COMMITTED_STATES.has(this.state); } From c85b120ed01d4dfb990385ea23565ee7a76527fc Mon Sep 17 00:00:00 2001 From: Durran Jordan Date: Thu, 26 Jun 2025 16:12:15 +0200 Subject: [PATCH 2/4] chore: make options internal --- src/transactions.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/transactions.ts b/src/transactions.ts index 0d8fdc40614..97b26142de9 100644 --- a/src/transactions.ts +++ b/src/transactions.ts @@ -79,6 +79,7 @@ export interface TransactionOptions extends Omit Date: Thu, 26 Jun 2025 17:57:16 +0200 Subject: [PATCH 3/4] chore: mark deprecated --- src/transactions.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/transactions.ts b/src/transactions.ts index 97b26142de9..945d24dc31d 100644 --- a/src/transactions.ts +++ b/src/transactions.ts @@ -74,12 +74,13 @@ export interface TransactionOptions extends Omit Date: Thu, 26 Jun 2025 19:25:50 +0200 Subject: [PATCH 4/4] chore: make transaction deprecated --- src/sessions.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/sessions.ts b/src/sessions.ts index 734ada4fbc0..ee1f13171bf 100644 --- a/src/sessions.ts +++ b/src/sessions.ts @@ -121,6 +121,7 @@ export class ClientSession /** @internal */ owner?: symbol | AbstractCursor; defaultTransactionOptions: TransactionOptions; + /** @deprecated - Will be made internal in the next major release */ transaction: Transaction; /** * @internal