tulir / whatsmeow

Go library for the WhatsApp web multidevice API
https://go.mau.fi/whatsmeow
Mozilla Public License 2.0
2.29k stars 430 forks source link

Not working when setting DeviceProps_HistorySyncConfig #594

Closed zhiru closed 6 months ago

zhiru commented 6 months ago

Hey!

when we pass: store.DeviceProps.RequireFullSync = proto.Bool(true)

store.DeviceProps.HistorySyncConfig = &waProto.DeviceProps_HistorySyncConfig{ FullSyncDaysLimit: proto.Uint32(3650), FullSyncSizeMbLimit: proto.Uint32(102400), }

or

store.DeviceProps.RequireFullSync = proto.Bool(false) store.DeviceProps.HistorySyncConfig = &waProto.DeviceProps_HistorySyncConfig{ FullSyncDaysLimit: proto.Uint32(HistorySyncValue 10), RecentSyncDaysLimit: proto.Uint32(HistorySyncValue 10), FullSyncSizeMbLimit: proto.Uint32(102400), }

it continues to bring full fullsync and not just messages from the last 5 days.

Any help @tulir ?

Mention: @hugodeco

tulir commented 6 months ago

The parameters are just passed to the mobile client, it's up to whatsapp what they want to return. I'd guess the full sync params are not applied at all when request full sync is false, and non-full syncs are 3 months worth of history.

In any case, whatsmeow has no control over how it's implemented by whatsapp

zhiru commented 6 months ago

hmmm So the ideal, for example, would be to create a filter so that if we pass a date it validates the timestamp of the message and ignores it?

hugodeco commented 6 months ago

we saw that exists a method to do a request for history sync, and it works since the messages ids that are requested, doesnt exists in whatsmeow database. Can you create a method to cleanup this internal history based on a timestamp ? So, we can use that cleanup method with the history sync method and all will be flowers ...