@@ -548,33 +548,40 @@ export default class RedisClient<
548548 }
549549
550550 if ( ! this . #options?. disableClientInfo ) {
551- this . #queue. addCommand ( [
552- 'CLIENT' ,
553- 'SETINFO' ,
554- 'LIB-NAME' ,
555- this . #options?. clientInfoTag
556- ? `node-redis(${ this . #options. clientInfoTag } )` : 'node-redis'
557- ] , {
558- chainId,
559- asap : true
560- } ) . catch ( err => {
561- // Client libraries are expected to ignore failures since they could be
562- // connected to an older server that doesn't support them.
563- if ( err ! instanceof SimpleError || ! err . isUnknownCommand ( ) ) {
564- return ;
565- }
566- } ) ;
567-
568- this . #queue. addCommand ( [ 'CLIENT' , 'SETINFO' , 'LIB-VER' , version ] , {
569- chainId,
570- asap : true
571- } ) . catch ( err => {
572- // Client libraries are expected to ignore failures since they could be
573- // connected to an older server that doesn't support them.
574- if ( err ! instanceof SimpleError || ! err . isUnknownCommand ( ) ) {
575- return ;
576- }
577- } ) ;
551+ promises . push (
552+ this . #queue. addCommand ( [
553+ 'CLIENT' ,
554+ 'SETINFO' ,
555+ 'LIB-NAME' ,
556+ this . #options?. clientInfoTag
557+ ? `node-redis(${ this . #options. clientInfoTag } )` : 'node-redis'
558+ ] , {
559+ chainId,
560+ asap : true
561+ } ) . catch ( err => {
562+ // Only throw if not a SimpleError - unknown subcommand
563+ // Client libraries are expected to ignore failures
564+ // of type SimpleError - unknown subcommand, which are
565+ // expected from older servers ( < v7 )
566+ if ( ! ( err instanceof SimpleError ) || ! err . isUnknownSubcommand ( ) ) {
567+ throw err ;
568+ }
569+ } )
570+ ) ;
571+ promises . push (
572+ this . #queue. addCommand ( [ 'CLIENT' , 'SETINFO' , 'LIB-VER' , version ] , {
573+ chainId,
574+ asap : true
575+ } ) . catch ( err => {
576+ // Only throw if not a SimpleError - unknown subcommand
577+ // Client libraries are expected to ignore failures
578+ // of type SimpleError - unknown subcommand, which are
579+ // expected from older servers ( < v7 )
580+ if ( ! ( err instanceof SimpleError ) || ! err . isUnknownSubcommand ( ) ) {
581+ throw err ;
582+ }
583+ } )
584+ ) ;
578585 }
579586
580587 const commands = await this . #handshake( this . #selectedDB) ;
0 commit comments