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(ui): assistants chat #1151

Merged
merged 8 commits into from
Sep 30, 2024
Merged

fix(ui): assistants chat #1151

merged 8 commits into from
Sep 30, 2024

Conversation

andrewrisse
Copy link
Contributor

@andrewrisse andrewrisse commented Sep 25, 2024

Description

There was an issue with chatting with assistants where if you created a new one and went back to your previous assistant chat, the messages were gone.

Investigation revealed that there were some edge cases where server side fetched data was not in sync with client side store state.

This resulted in a large refactor to fetch data on the client side, instead of server side. This decision was made because the multiple pages depend on threads, files, and assistants and that data is modified in various places. Invalidating data at the root level whenever this data changed (triggering a load function that reloaded all threads, assistants, and files) would be too much overhead and network data. It's also complicated to keep the server fetched data in sync with the modified versions in our stores. It's simpler, cleaner, and less buggy to just fetch the data client side and manage it in the stores instead of trying to fetch it all server side, then update the stores.

I found some logical and testing issues during this refactor that had to be addressed for tests to pass, so there are several changes throughout, as well as new/modified tests.

Also fixes an issue where users could upload audio files to the file-managment page or assistants. Audio files are only allowed on the chat page without assistants.

Checklist before merging

@andrewrisse andrewrisse added the bug Something isn't working label Sep 25, 2024
@andrewrisse andrewrisse self-assigned this Sep 25, 2024
Copy link

netlify bot commented Sep 25, 2024

Deploy Preview for leapfrogai-docs canceled.

Name Link
🔨 Latest commit 179b2fc
🔍 Latest deploy log https://app.netlify.com/sites/leapfrogai-docs/deploys/66fab368c8f66c0008de384e

@justinthelaw justinthelaw changed the title bug(ui): assistants chat fix(ui): assistants chat Sep 26, 2024
@andrewrisse andrewrisse marked this pull request as ready for review September 26, 2024 22:34
@andrewrisse andrewrisse requested a review from a team as a code owner September 26, 2024 22:34
Copy link
Contributor

@gregclark-defenseunicorns gregclark-defenseunicorns left a comment

Choose a reason for hiding this comment

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

Design Review passed

@andrewrisse andrewrisse merged commit 04ae4b0 into main Sep 30, 2024
17 checks passed
@andrewrisse andrewrisse deleted the data-flow-fix branch September 30, 2024 18:16
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
None yet
Development

Successfully merging this pull request may close these issues.

3 participants