Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(streaming): Data Truncation Issue in useHandleStream Function #2079

Merged
merged 3 commits into from
Jan 26, 2024

Conversation

openperf
Copy link
Contributor

Description
This PR introduces modifications to the useHandleStream function in the useHandleStream.ts file, aiming to resolve the issue of data truncation leading to incomplete display of Q&A on the front end. By optimizing data handling logic and enhancing error management, this change ensures the integrity of data streams and accurate display on the front end.

Changes Made
Introduced a variable incompleteData to store and process incomplete data fragments.
Implemented logic to concatenate incomplete data with new chunks and parse them once complete.
Added error handling to gracefully manage the parsing of incomplete data and data strings.
Improved the handling of the first data chunk, enhancing the coherence of data processing.
Motivation and Context
The primary motivation for these changes is to address the issue of incomplete front-end display, caused by data stream truncation under unstable network conditions. This optimization is intended to enhance the stability and reliability of the application when handling large volumes of real-time data streams, ensuring that the user interface correctly displays complete Q&A information.

Checklist before requesting a review
My code follows the style guidelines of this project.
I have performed a self-review of my own code.
I have commented in hard-to-understand areas of my code.
I have made corresponding changes to the documentation (if applicable).
I have added tests that prove my fix is effective or that my feature works (if applicable).
New and existing unit tests pass locally with my changes.
Any dependent changes have been merged and published in downstream modules (if applicable).
Screenshots (if appropriate)
image

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jan 24, 2024
Copy link

vercel bot commented Jan 24, 2024

Someone is attempting to deploy a commit to the Quivr-app Team on Vercel.

A member of the Team first needs to authorize it.

@dosubot dosubot bot added area: frontend Related to frontend functionality or under the /frontend directory autorelease: pending labels Jan 24, 2024
Copy link
Collaborator

@StanGirard StanGirard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot my friend !

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 26, 2024
Copy link
Collaborator

@StanGirard StanGirard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot my friend !

@StanGirard StanGirard changed the title Fix Data Truncation Issue in useHandleStream Function Fix: Data Truncation Issue in useHandleStream Function Jan 26, 2024
Copy link

vercel bot commented Jan 26, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
quivrapp ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 26, 2024 2:01am

@StanGirard StanGirard changed the title Fix: Data Truncation Issue in useHandleStream Function fix(streaming): Data Truncation Issue in useHandleStream Function Jan 26, 2024
@StanGirard StanGirard merged commit 7c9fdd2 into QuivrHQ:main Jan 26, 2024
2 of 6 checks passed
StanGirard added a commit that referenced this pull request Jan 26, 2024
🤖 I have created a release *beep* *boop*
---


## 0.0.184 (2024-01-26)

## What's Changed
* feat(panel): added by @Zewed in
#2088
* feat: 🎸 api by @StanGirard in
#2078
* fix(frontend): clear message input on submit by @Zewed in
#2087
* fix: 🐛 related by @StanGirard in
#2090
* feat: Added translation status badge from inlang by @NilsJacobsen in
#2080
* fix(streaming): Data Truncation Issue in useHandleStream Function by
@openperf in #2079
* feat: 🎸 sources by @StanGirard in
#2092
* fix(frontend): clean related Brains useEffect by @Zewed in
#2091

## New Contributors
* @openperf made their first contribution in
#2079

**Full Changelog**:
v0.0.183...v0.0.184

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: frontend Related to frontend functionality or under the /frontend directory autorelease: pending lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants