Skip to content

fix: chat functionality with error handling - #655

Merged
Roopan-Microsoft merged 3 commits into
devfrom
bugfix/response-loader
Jun 4, 2026
Merged

fix: chat functionality with error handling#655
Roopan-Microsoft merged 3 commits into
devfrom
bugfix/response-loader

Conversation

@Ayaz-Microsoft

Copy link
Copy Markdown
Contributor

Purpose

This PR fixes a bug in which user was to chat while previous chat was in-progress and handled error.

Does this introduce a breaking change?

  • Yes
  • No

Golden Path Validation

  • I have tested the primary workflows (the "golden path") to ensure they function correctly without errors.

Deployment Validation

  • I have validated the deployment process successfully and all services are running as expected with this change.

What to Check

Verify that the following are valid

  • ...

Other Information

@Ayaz-Microsoft
Ayaz-Microsoft marked this pull request as ready for review June 4, 2026 07:44
Copilot AI review requested due to automatic review settings June 4, 2026 07:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the frontend chat UI to prevent overlapping chat requests by tracking per-message request state and improving error handling when the chat API fails or returns an empty response.

Changes:

  • Track each chat request with a requestId and pending flag to update the correct message when responses arrive.
  • Disable the chat input while any message is pending to prevent starting a new request mid-flight.
  • Add a localized user-facing error message for failed chat fetches.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
App/frontend-app/src/components/chat/chatRoom.tsx Adds request tracking (requestId/pending), updates message replacement logic, and disables input while requests are pending.
App/frontend-app/src/api/apiTypes/chatTypes.ts Extends the chat response type with optional fields used for client-side request/message state.
App/frontend-app/public/locales/en/translation.json Adds the localized “error fetching answer” message shown on failure.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread App/frontend-app/src/api/apiTypes/chatTypes.ts
Comment thread App/frontend-app/src/components/chat/chatRoom.tsx
Comment thread App/frontend-app/src/components/chat/chatRoom.tsx
Comment thread App/frontend-app/src/components/chat/chatRoom.tsx
Copilot AI review requested due to automatic review settings June 4, 2026 12:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Comment thread App/frontend-app/src/AppContext.tsx
@Roopan-Microsoft
Roopan-Microsoft merged commit cb21334 into dev Jun 4, 2026
6 checks passed
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 1.9.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants