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

Supabase client is now a singleton #668

Merged
merged 1 commit into from
Dec 29, 2023

Conversation

nerfZael
Copy link
Contributor

Made supabase client a singleton to prevent the messages below:
image
When loading chat logs there is a race condition which causes refechChats to resolve while still pending.
Await EvoThread load helps and reduces the race conditions but they still happen. To prevent this, we now call the fetch method without react query.

Copy link

vercel bot commented Dec 28, 2023

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

Name Status Preview Updated (UTC)
evo-ninja ✅ Ready (Inspect) Visit Preview Dec 28, 2023 1:54pm

@nerfZael nerfZael mentioned this pull request Dec 29, 2023
if (!this._threads[config.chatId]) {
this._threads[config.chatId] = new EvoThread(config);
this._threads[config.chatId] = await EvoThread.load(config);
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice, this is a much better way to handle this.

@dOrgJelli dOrgJelli merged commit c086221 into dev Dec 29, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants