Skip to content

Conversation

@Fabilin
Copy link
Member

@Fabilin Fabilin commented Nov 28, 2023

This PR resolves the concurrency issue described in #148 by keeping track of which messages have been handled, and handling new ones as they first arrive - no matter the protocol through which they arrive. This not only ensures the loading state is valid, but also that duplicate messages do not get displayed after a page refresh.

The implementation operates on the following assumptions:

  1. For any given bot response, the POST response may be processed at any point, before or after any number of SSE messages
  2. POST responses always hold the same messages, in the same order, as those sent through SSE
  3. POST responses may get dropped due to connection loss
  4. SSE messages may get dropped due to connection loss
  5. SSE messages always arrive in order
  6. If an SSE message is received, all messages before it have been received and processed (at least for that response)
  7. SSE messages may arrive after a page reload, due to fix #1557 web_connector: retry sending messages after SSE disconnection tock#1561

Requires theopenconversationkit/tock#1563
Resolves #148

@Fabilin Fabilin marked this pull request as draft November 29, 2023 08:58
@Fabilin Fabilin marked this pull request as ready for review November 29, 2023 16:54
@francoisno francoisno requested a review from elebescond December 4, 2023 15:06
@francoisno francoisno added the bug Something isn't working label Dec 4, 2023
@francoisno francoisno changed the title resolve #148: handle responses in SSE or POST fix #148: handle responses in SSE or POST Dec 4, 2023
@Fabilin Fabilin merged commit 610e3db into theopenconversationkit:master Dec 8, 2023
@francoisno francoisno added this to the 23.9.0 milestone Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

In SSE mode, loading may end too early

3 participants