Description
openedon Dec 19, 2022
- Package Name: @azure/communication-chat
- Package Version: ^1.1.2
- Operating system: MacOS, Linux (Ubuntu 18, 20)
- nodejs
- version: 18.8.0
- browser
- name/version: Google Chrome / Version 108.0.5359.124 (Official Build) (arm64)
- typescript
- version: ^4.1.2
- Is the bug related to documentation in
- README.md
- source code documentation
- SDK API docs on https://docs.microsoft.com
Describe the bug
While having an opened thread, with some messages of the thread loaded via the listMessages()
method of the ChatClient (and thus, a continuationToken
, or nextLink
, present and valid), should a new message arrive in between (handled via the chatMessageReceived
from the client itself), and afterwards the continuationToken is used to fetch a previous set of messages, the message that arrived in real time will be present in the previous set as well.
To Reproduce
Steps to reproduce the behavior:
- Load the messages of a thread that has more messages than limit sent to Azure (e.g. thread has 50 messages, request is sent with a limit of 15)
- Receive a new message in real time (Handled by the
chatMessageReceived
event) - Load a previous set of messages (Previous 15 in this case)
- Message received from real-time appears in the previously fetched set using the same cont token.
Expected behavior
Messages retrieved with existing continuationToken should not contain any messages that were received after the continuationToken was created.
Screenshots
Additional context
Problem most easily reproducible in an infinite scroll environment.