tinode / tinode-js

Tinode javascript bindings
Apache License 2.0
52 stars 42 forks source link

Client is not fetching missing messages #71

Open dilshansdoq opened 1 year ago

dilshansdoq commented 1 year ago

Describe the bug Client (i.e. SDK) is not fetching messages which are missing. Take this example. A and B have p2p topic. Both have seen upto 50 seqid. A goes offline (or even left this p2p topic, just so A is not acknowledging B's messages). B sends 50 messages to A. A subscribes to topic and ask for data from server. get:what:data:since=50,limit=24. Server will send 24 messages from 100-76. A's view is full. Now A scrolls to see earlier messages. Range 75-51 is missing. SDK doesn't call server to fetch those messages.

To Reproduce Steps to reproduce the behavior:

  1. Login with two users A and B such that they are upto x seqid.
  2. A goes offline. B sends 50 messages such that latest seqid is x+50.
  3. A comes online. A will see latest n messages i.e. x+50-n to x+50.
  4. A scrolls to see more messages. A cannot see x to x+50-n messages. These are missing

Expected behavior No messages should be missing unless and until deleted from server.

Screenshots Sender: image Receiver(missing messages): Screenshot from 2023-06-15 01-18-24

Environment (please complete the following information):

Console log missing-messages.zip

Additional context This gets solved, if A clears its cache. Now all messages are fetched with page size.

or-else commented 1 year ago

I this is fixed in 0.23.

dilshansdoq commented 1 year ago

Cool. Is this change committed? I couldn't find. Could you please send it.

or-else commented 1 year ago

It's one of the million changes that were committed to 23. It's the changes related to pinning messages and the message gaps.

or-else commented 1 year ago

It's in the next branch.