@@ -549,17 +549,18 @@ export class BaileysStartupService extends ChannelStartupService {
549549 this . logger . info ( `Browser: ${ browser } ` ) ;
550550 }
551551
552- let version ;
553- let log ;
554-
555- if ( session . VERSION ) {
556- version = session . VERSION . split ( '.' ) ;
557- log = `Baileys version env: ${ version } ` ;
558- } else {
559- const baileysVersion = await fetchLatestWaWebVersion ( { } ) ;
560- version = baileysVersion . version ;
561- log = `Baileys version: ${ version } ` ;
562- }
552+ const baileysVersion = await fetchLatestWaWebVersion ( { } ) ;
553+ const version = baileysVersion . version ;
554+ const log = `Baileys version: ${ version . join ( '.' ) } ` ;
555+
556+ // if (session.VERSION) {
557+ // version = session.VERSION.split('.');
558+ // log = `Baileys version env: ${version}`;
559+ // } else {
560+ // const baileysVersion = await fetchLatestWaWebVersion({});
561+ // version = baileysVersion.version;
562+ // log = `Baileys version: ${version}`;
563+ // }
563564
564565 this . logger . info ( log ) ;
565566
@@ -1059,6 +1060,8 @@ export class BaileysStartupService extends ChannelStartupService {
10591060 'failed to decrypt message' ,
10601061 'SessionError' ,
10611062 'Invalid PreKey ID' ,
1063+ 'No session record' ,
1064+ 'No session found to decrypt message' ,
10621065 ] . some ( ( err ) => param ?. includes ?.( err ) ) ,
10631066 )
10641067 ) {
@@ -2559,7 +2562,9 @@ export class BaileysStartupService extends ChannelStartupService {
25592562 imageBuffer = Buffer . from ( base64Data , 'base64' ) ;
25602563 } else {
25612564 const timestamp = new Date ( ) . getTime ( ) ;
2562- const url = `${ image } ?timestamp=${ timestamp } ` ;
2565+ const parsedURL = new URL ( image ) ;
2566+ parsedURL . searchParams . set ( 'timestamp' , timestamp . toString ( ) ) ;
2567+ const url = parsedURL . toString ( ) ;
25632568
25642569 let config : any = { responseType : 'arraybuffer' } ;
25652570
@@ -2780,7 +2785,9 @@ export class BaileysStartupService extends ChannelStartupService {
27802785
27812786 if ( isURL ( audio ) ) {
27822787 const timestamp = new Date ( ) . getTime ( ) ;
2783- const url = `${ audio } ?timestamp=${ timestamp } ` ;
2788+ const parsedURL = new URL ( audio ) ;
2789+ parsedURL . searchParams . set ( 'timestamp' , timestamp . toString ( ) ) ;
2790+ const url = parsedURL . toString ( ) ;
27842791
27852792 const config : any = { responseType : 'stream' } ;
27862793
@@ -3709,7 +3716,9 @@ export class BaileysStartupService extends ChannelStartupService {
37093716 let pic : WAMediaUpload ;
37103717 if ( isURL ( picture ) ) {
37113718 const timestamp = new Date ( ) . getTime ( ) ;
3712- const url = `${ picture } ?timestamp=${ timestamp } ` ;
3719+ const parsedURL = new URL ( picture ) ;
3720+ parsedURL . searchParams . set ( 'timestamp' , timestamp . toString ( ) ) ;
3721+ const url = parsedURL . toString ( ) ;
37133722
37143723 let config : any = { responseType : 'arraybuffer' } ;
37153724
@@ -4001,7 +4010,9 @@ export class BaileysStartupService extends ChannelStartupService {
40014010 let pic : WAMediaUpload ;
40024011 if ( isURL ( picture . image ) ) {
40034012 const timestamp = new Date ( ) . getTime ( ) ;
4004- const url = `${ picture . image } ?timestamp=${ timestamp } ` ;
4013+ const parsedURL = new URL ( picture . image ) ;
4014+ parsedURL . searchParams . set ( 'timestamp' , timestamp . toString ( ) ) ;
4015+ const url = parsedURL . toString ( ) ;
40054016
40064017 let config : any = { responseType : 'arraybuffer' } ;
40074018
0 commit comments