Skip to content

Improved Error Handling for Session Creation#332

Open
Dhara124 wants to merge 1 commit intodevelopfrom
security-fixes
Open

Improved Error Handling for Session Creation#332
Dhara124 wants to merge 1 commit intodevelopfrom
security-fixes

Conversation

@Dhara124
Copy link
Copy Markdown
Collaborator

Description

This PR improves the user experience when session creation fails (e.g., due to authentication requirements or daily message limits) by displaying the specific reason from the backend.

Key Changes

  • Redux Thunk Update: Modified createSession in chatSlice.js to use rejectWithValue. This ensures that 403/429 error responses from the backend are properly captured in the action payload.
  • Dynamic Error Toasts: Updated MessageInput.jsx to read the message field from the error payload.
    • Before: Always showed "Failed to create session".
    • After: Shows "You have reached the daily limit of 15 messages..." or "You must be signed in to create a direct or compare mode session."

Verification

  • Attempted to create a direct mode session as an anonymous user; snackbar correctly displayed the "must be signed in" message.
  • Verified that generic errors still fall back to "Failed to create session".

@Dhara124 Dhara124 changed the base branch from master to develop April 15, 2026 09:15
@netlify
Copy link
Copy Markdown

netlify bot commented Apr 15, 2026

Deploy Preview for indic-arena ready!

Name Link
🔨 Latest commit faf453a
🔍 Latest deploy log https://app.netlify.com/projects/indic-arena/deploys/69df599e4596590008523cbb
😎 Deploy Preview https://deploy-preview-332--indic-arena.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

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