Skip to content

[Bug] duplicate messages when the chat gets hidden and re-shown with SSE enabled #179

@Fabilin

Description

@Fabilin

The issue

When the SSE feature is enabled, if the Chat component gets dismounted then later remounted (typically because of a toggle button in the interface), any message received is displayed twice in the interface.

Diagnosis

This issue seems to be linked to #151. Indeed, the record storing which messages have been received by POST and which have been received by SSE is local to the useTock hook and therefore to the Chat component which uses it. This would not be an issue if the SSE connection was also local to this hook, but it is currently managed through global values. As an aside, this global SSE state would also prevent multiple SSE-enabled TOCK bots from co-existing on a single-page application.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions