@@ -257,6 +257,7 @@ export class Topology extends TypedEventEmitter<TopologyEvents> {
257
257
258
258
/**
259
259
* @param seedlist - a list of HostAddress instances to connect to
260
+ * TODO(NODE-5682): don't pass in entire MongoOptions object
260
261
*/
261
262
constructor ( client : MongoClient , options : MongoOptions ) {
262
263
super ( ) ;
@@ -293,9 +294,8 @@ export class Topology extends TypedEventEmitter<TopologyEvents> {
293
294
this . component = 'topology' ;
294
295
295
296
if ( options . srvHost && ! options . loadBalanced ) {
296
- this . s . srvPoller =
297
- // @ts -expect-error: todo
298
- options . srvPoller ??
297
+ // @ts -expect-error: todo
298
+ options . srvPoller ??
299
299
new SrvPoller ( {
300
300
heartbeatFrequencyMS : this . s . heartbeatFrequencyMS ,
301
301
srvHost : options . srvHost ,
@@ -510,7 +510,7 @@ export class Topology extends TypedEventEmitter<TopologyEvents> {
510
510
* @returns An instance of a `Server` meeting the criteria of the predicate provided
511
511
*/
512
512
async selectServer (
513
- selector : string | ReadPreference | ServerSelector ,
513
+ selector : string | ReadPreference | ServerSelector | undefined ,
514
514
options : SelectServerOptions
515
515
) : Promise < Server > {
516
516
const shouldInitialize = this . s . state === STATE_UNITIALIZED ;
@@ -576,7 +576,7 @@ export class Topology extends TypedEventEmitter<TopologyEvents> {
576
576
) {
577
577
this . client . mongoLogger ?. debug (
578
578
MongoLoggableComponent . SERVER_SELECTION ,
579
- new ServerSelectionStartedEvent ( selector , this . description , options . operationName )
579
+ new ServerSelectionStartedEvent ( serverSelector , this . description , options . operationName )
580
580
) ;
581
581
}
582
582
let timeout ;
@@ -599,7 +599,7 @@ export class Topology extends TypedEventEmitter<TopologyEvents> {
599
599
this . client . mongoLogger ?. debug (
600
600
MongoLoggableComponent . SERVER_SELECTION ,
601
601
new ServerSelectionSucceededEvent (
602
- selector ,
602
+ serverSelector ,
603
603
this . description ,
604
604
transaction . server . pool . address ,
605
605
options . operationName
@@ -662,7 +662,7 @@ export class Topology extends TypedEventEmitter<TopologyEvents> {
662
662
this . client . mongoLogger ?. debug (
663
663
MongoLoggableComponent . SERVER_SELECTION ,
664
664
new ServerSelectionFailedEvent (
665
- selector ,
665
+ serverSelector ,
666
666
this . description ,
667
667
timeoutError ,
668
668
options . operationName
0 commit comments