@@ -558,33 +558,40 @@ export default class RedisClient<
558558 }
559559
560560 if ( ! this . #options?. disableClientInfo ) {
561- this . #queue. addCommand ( [
562- 'CLIENT' ,
563- 'SETINFO' ,
564- 'LIB-NAME' ,
565- this . #options?. clientInfoTag
566- ? `node-redis(${ this . #options. clientInfoTag } )` : 'node-redis'
567- ] , {
568- chainId,
569- asap : true
570- } ) . catch ( err => {
571- // Client libraries are expected to ignore failures since they could be
572- // connected to an older server that doesn't support them.
573- if ( err ! instanceof SimpleError || ! err . isUnknownCommand ( ) ) {
574- return ;
575- }
576- } ) ;
577-
578- this . #queue. addCommand ( [ 'CLIENT' , 'SETINFO' , 'LIB-VER' , version ] , {
579- chainId,
580- asap : true
581- } ) . catch ( err => {
582- // Client libraries are expected to ignore failures since they could be
583- // connected to an older server that doesn't support them.
584- if ( err ! instanceof SimpleError || ! err . isUnknownCommand ( ) ) {
585- return ;
586- }
587- } ) ;
561+ promises . push (
562+ this . #queue. addCommand ( [
563+ 'CLIENT' ,
564+ 'SETINFO' ,
565+ 'LIB-NAME' ,
566+ this . #options?. clientInfoTag
567+ ? `node-redis(${ this . #options. clientInfoTag } )` : 'node-redis'
568+ ] , {
569+ chainId,
570+ asap : true
571+ } ) . catch ( err => {
572+ // Only throw if not a SimpleError - unknown subcommand
573+ // Client libraries are expected to ignore failures
574+ // of type SimpleError - unknown subcommand, which are
575+ // expected from older servers ( < v7 )
576+ if ( ! ( err instanceof SimpleError ) || ! err . isUnknownSubcommand ( ) ) {
577+ throw err ;
578+ }
579+ } )
580+ ) ;
581+ promises . push (
582+ this . #queue. addCommand ( [ 'CLIENT' , 'SETINFO' , 'LIB-VER' , version ] , {
583+ chainId,
584+ asap : true
585+ } ) . catch ( err => {
586+ // Only throw if not a SimpleError - unknown subcommand
587+ // Client libraries are expected to ignore failures
588+ // of type SimpleError - unknown subcommand, which are
589+ // expected from older servers ( < v7 )
590+ if ( ! ( err instanceof SimpleError ) || ! err . isUnknownSubcommand ( ) ) {
591+ throw err ;
592+ }
593+ } )
594+ ) ;
588595 }
589596
590597 const commands = await this . #handshake( this . #selectedDB) ;
0 commit comments