tulir / whatsmeow

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

Failed to sync app state after notification: failed to decode app state regular patches: failed to verify patch v564: mismatching LTHash #651

Open brunoaduarte opened 2 months ago

brunoaduarte commented 2 months ago

@tulir , I'm getting this error after I created a label via WhatsApp Web.

04:16:22.460 [Client/Recv DEBUG] <notification from="s.whatsapp.net" id="484950606" t="1724915782" type="server_sync"><collection name="regular" version="588"/></notification>
04:16:22.466 [Client DEBUG] Got server sync notification that app state regular has updated to version 588
04:16:22.466 [Client/Send DEBUG] <ack class="notification" id="484950606" to="s.whatsapp.net" type="server_sync"/>
04:16:22.467 [Client/Send DEBUG] <iq id="103.122-15" to="s.whatsapp.net" type="set" xmlns="w:sync:app:state"><sync><collection name="regular" return_snapshot="false" version="563"/></sync></iq>
04:16:22.828 [Client/Recv DEBUG] <iq from="s.whatsapp.net" id="103.122-15" type="result">
  <sync>
    <collection name="regular">
      <patches>
        <patch><!-- 255 bytes --></patch>
        <patch><!-- 443 bytes --></patch>
        <patch><!-- 255 bytes --></patch>
        <patch><!-- 901 bytes --></patch>
        <patch><!-- 613 bytes --></patch>
        <patch><!-- 697 bytes --></patch>
        <patch><!-- 713 bytes --></patch>
        <patch><!-- 597 bytes --></patch>
        <patch><!-- 647 bytes --></patch>
        <patch><!-- 1225 bytes --></patch>
        <patch><!-- 613 bytes --></patch>
        <patch><!-- 917 bytes --></patch>
        <patch><!-- 1087 bytes --></patch>
        <patch><!-- 663 bytes --></patch>
        <patch><!-- 647 bytes --></patch>
        <patch><!-- 613 bytes --></patch>
        <patch><!-- 713 bytes --></patch>
        <patch><!-- 647 bytes --></patch>
        <patch><!-- 647 bytes --></patch>
        <patch><!-- 1053 bytes --></patch>
        <patch><!-- 663 bytes --></patch>
        <patch><!-- 867 bytes --></patch>
        <patch><!-- 679 bytes --></patch>
        <patch><!-- 1127 bytes --></patch>
        <patch><!-- 581 bytes --></patch>
      </patches>
    </collection>
  </sync>
</iq>
04:16:22.831 [Client ERROR] Failed to sync app state after notification: failed to decode app state regular patches: failed to verify patch v564: mismatching LTHash

Tried disconnecting the linked device and rescanning the QR code with whatsmeow, but the error persists.

George-Seven commented 2 months ago

Apparently not a whatsmeow bug - https://github.com/tulir/whatsmeow/pull/519#issuecomment-1863455221

You need to patch this line of whatsmeow yourself -

https://github.com/tulir/whatsmeow/pull/519/commits/4d2f98c8383f8b6f0600276b4ea7eb510a5b1fb9

brunoaduarte commented 2 months ago

Apparently not a whatsmeow bug - #519 (comment)

You need to patch this line of whatsmeow yourself -

4d2f98c

This can be a workaround, but have you seen this comment?

Disabling validation is not a solution, the bug should be fixed instead

https://github.com/tulir/whatsmeow/pull/519#issuecomment-1863455221

Thanks!