Skip to content

Commit e89a431

Browse files
committed
make typescript happy
1 parent 143e41a commit e89a431

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/sessions.ts

+2-5
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ class ClientSession extends TypedEventEmitter<ClientSessionEvents> {
103103
transaction: Transaction;
104104
/** @internal */
105105
[kServerSession]?: ServerSession;
106+
/** @internal */
106107
[kSnapshotTime]?: Timestamp;
107108
/** @internal */
108109
[kSnapshotEnabled] = false;
@@ -140,13 +141,10 @@ class ClientSession extends TypedEventEmitter<ClientSessionEvents> {
140141

141142
this[kSnapshotEnabled] = true;
142143
if (options.causalConsistency === true) {
143-
// TODO: throw validation error; MongoDriverError or more specific
144144
throw new MongoDriverError(
145145
'Properties "causalConsistency" and "snapshot" are mutually exclusive'
146146
);
147147
}
148-
149-
// TODO(NODE-3394): also validate server version >= 5.0
150148
}
151149

152150
this.topology = topology;
@@ -283,7 +281,6 @@ class ClientSession extends TypedEventEmitter<ClientSessionEvents> {
283281
*/
284282
startTransaction(options?: TransactionOptions): void {
285283
if (this[kSnapshotEnabled]) {
286-
// TODO: should this be a different type?
287284
throw new MongoDriverError('Transactions are not allowed with snapshot sessions');
288285
}
289286

@@ -849,7 +846,7 @@ function applySession(
849846
command.readConcern = command.readConcern || {};
850847
Object.assign(command.readConcern, { afterClusterTime: session.operationTime });
851848
} else if (session[kSnapshotEnabled]) {
852-
command.readConcern = command.readConcern || { level: ReadConcernLevel.snapshot }; // TODO: is there a better place to set this?
849+
command.readConcern = command.readConcern || { level: ReadConcernLevel.snapshot };
853850
if (session[kSnapshotTime] !== undefined) {
854851
Object.assign(command.readConcern, { atClusterTime: session[kSnapshotTime] });
855852
}

0 commit comments

Comments
 (0)