theopenconversationkit / theopenconversationkit/tock-react-kit
SSE connection presents some instabilities
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 23
- Forks
- 23
- Avg merge
- 5m
- Merged PRs (30d)
- 1
Description
While using the TOCK React Kit in production with SSE enabled, cases of the SSE connection either disappearing or multiplying occurred sporadically. The current EventSource-based implementation is particularly hard to debug, due to the lack of information on errors or retries (the error event notably is a basic object with no specific data). EventSource is also limited, preventing us from passing on custom headers or a body with the stream request.
A previous PR attempted to replace EventSource with the @microsoft/fetch-event-source package, but this implementation caused other issues (see #185). I believe we could try a custom fetch-based implementation using a well-maintained parsing library like eventsource-parser.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the current EventSource-based SSE connection entry point in the React Kit and review issue #185 before changing the approach. Evaluate a fetch-based implementation with eventsource-parser, preserving the stream behavior while exposing error and retry details and allowing custom headers or a request body. Done means the intermittent disappearance or multiplication is addressed without reintroducing the issues from #185.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100