Skip to content

refactor: use React Query mutation for message sending#278

Open
ruudandriessen wants to merge 1 commit intomainfrom
ruudandriessen/rq-send-message
Open

refactor: use React Query mutation for message sending#278
ruudandriessen wants to merge 1 commit intomainfrom
ruudandriessen/rq-send-message

Conversation

@ruudandriessen
Copy link
Copy Markdown
Owner

Summary

Replaced manual state management with React Query's useMutation hook for handling message sends. This reduces boilerplate, improves error handling consistency, and aligns with existing React Query patterns in the codebase.

Changes

  • Moved async send logic into mutationFn
  • Removed sending state in favor of sendMutation.isPending
  • Removed setSending calls and replaced error handling with mutation error surface
  • Used onSettled callback for cleanup (focusing input)
  • Added sendMutation.reset() to clear previous errors before new sends

🤖 Generated with Claude Code

Replaced manual sending and error state management with useMutation, reducing boilerplate and improving consistency with React Query patterns. The mutation handles pending state, error surface, and lifecycle callbacks.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
clanki-ai Ready Ready Preview, Comment Mar 10, 2026 9:12pm
clanki-ai-marketing Ready Ready Preview, Comment Mar 10, 2026 9:12pm

Request Review

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.

1 participant