Skip to content

Continuation token fetches invalid message items #24277

Open

Description

  • 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

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:

  1. 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)
  2. Receive a new message in real time (Handled by the chatMessageReceived event)
  3. Load a previous set of messages (Previous 15 in this case)
  4. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Labels

Communication - ChatService AttentionWorkflow: This issue is responsible by Azure service team.bugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions