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: fix all problems with the request of clearing a chat #619

Merged
merged 10 commits into from
Nov 3, 2024

Conversation

FleetAdmiralJakob
Copy link
Owner

@FleetAdmiralJakob FleetAdmiralJakob commented Oct 30, 2024

Rework of #425

  • Expires all requests older than a day
  • Only one open request at a time
  • Validation if a user is allowed to accept a request to clear the chat

Another problem this PR is fixing is this:
image

The problem was that our old technique overate database bandwidth as it goes through all messages and not only through the requests. The solution is to make a new table only for requests and merge requests and messages in the getMessages queries. I used the automatically set up index by _creationTime.

Copy link

vercel bot commented Oct 30, 2024

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

Name Status Preview Comments Updated (UTC)
chat-io ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 2, 2024 9:10am

Copy link

sweep-ai bot commented Oct 30, 2024

Hey @FleetAdmiralJakob, here is an example of how you can ask me to improve this pull request:

@Sweep Add unit tests for the `useScrollBehavior` hook in `src/app/(internal-sites)/chats/[chatId]/page.tsx` to verify:
- Correct initialization of isNearBottom state
- Proper handling of scroll events
- Correct behavior of scrollToBottom function
- Proper handling of new messages arriving

📖 For more information on how to use Sweep, please read our documentation.

- additionally added a scroll to bottom button
@FleetAdmiralJakob FleetAdmiralJakob merged commit f8c6eb2 into main Nov 3, 2024
5 checks passed
@FleetAdmiralJakob FleetAdmiralJakob deleted the clear-chat-requests branch November 3, 2024 02:16
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.

Change preview text of delete request
1 participant