From c81c074dbd5048c82527577ac0fd475eec450df6 Mon Sep 17 00:00:00 2001 From: Rajeh Taher Date: Thu, 22 Jan 2026 14:13:00 +0200 Subject: [PATCH] defaults, index: change shouldSyncHistoryMessage behavior --- src/Defaults/index.ts | 4 +++- src/Socket/index.ts | 7 ------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/Defaults/index.ts b/src/Defaults/index.ts index e46035d8..e940efa0 100644 --- a/src/Defaults/index.ts +++ b/src/Defaults/index.ts @@ -62,7 +62,9 @@ export const DEFAULT_CONNECTION_CONFIG: SocketConfig = { markOnlineOnConnect: true, syncFullHistory: true, patchMessageBeforeSending: msg => msg, - shouldSyncHistoryMessage: () => true, + shouldSyncHistoryMessage: ({ syncType }: proto.Message.IHistorySyncNotification) => { + return syncType !== proto.HistorySync.HistorySyncType.FULL + }, shouldIgnoreJid: () => false, linkPreviewImageThumbnailWidth: 192, transactionOpts: { maxCommitRetries: 10, delayBetweenTriesMs: 3000 }, diff --git a/src/Socket/index.ts b/src/Socket/index.ts index 3ee2d850..97c4785e 100644 --- a/src/Socket/index.ts +++ b/src/Socket/index.ts @@ -9,13 +9,6 @@ const makeWASocket = (config: UserFacingSocketConfig) => { ...config } - // If the user hasn't provided their own history sync function, - // let's create a default one that respects the syncFullHistory flag. - // TODO: Change - if (config.shouldSyncHistoryMessage === undefined) { - newConfig.shouldSyncHistoryMessage = () => !!newConfig.syncFullHistory - } - return makeCommunitiesSocket(newConfig) }