File tree Expand file tree Collapse file tree
src/api/integrations/channel/whatsapp Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3796,6 +3796,16 @@ export class BaileysStartupService extends ChannelStartupService {
37963796 }
37973797 contactPayload . pnJid = jid ;
37983798
3799+ // Ensure local collection LTHash is 100% in sync with WhatsApp Cloud before mutating
3800+ try {
3801+ if ( typeof ( this . client as any ) . resyncAppState === 'function' ) {
3802+ this . logger . info ( `[saveContact] Syncing full critical_unblock_low snapshot from WhatsApp Cloud...` ) ;
3803+ await ( this . client as any ) . resyncAppState ( [ 'critical_unblock_low' ] , true ) ;
3804+ }
3805+ } catch ( syncErr ) {
3806+ this . logger . warn ( `[saveContact] resyncAppState warning: ${ syncErr } ` ) ;
3807+ }
3808+
37993809 this . logger . info ( `[saveContact] Attempting chatModify for PN jid=${ jid } with payload=${ JSON . stringify ( contactPayload ) } ` ) ;
38003810
38013811 const result = await this . client . chatModify (
You can’t perform that action at this time.
0 commit comments