Skip to content

FIX: do not show converter-restoration warning in empty chat - #3150

Merged
Justin Song (jsong468) merged 1 commit into
microsoft:mainfrom
RohithPariki:auto-fix-3147
Oct 13, 2026
Merged

Justin Song (jsong468) merged 1 commit into
microsoft:mainfrom
RohithPariki:auto-fix-3147

Conversation

@RohithPariki

Copy link
Copy Markdown
Contributor

Fixes #3147

Description

In frontend/src/components/Chat/ChatWindow.tsx, opening an empty Chat displayed the warning:

Converter choices could not be restored. Select and apply converters again before sending.
both while the page initially loaded and after a target was available, even when no converters had been selected and no draft recovery failed.

Root Cause

recoveredDraftWarningConversationId starts as null. In an empty chat or prior to opening/loading an existing conversation, viewedConversationId (activeConversationId ?? conversationId) is also null. The condition:
sx {recoveredDraftWarningConversationId === viewedConversationId && (
evaluated null === null as true, causing the warning message bar to render unconditionally on fresh empty chat sessions.

Solution

  • Updated the warning render condition in ChatWindow.tsx to require that recoveredDraftWarningConversationId is truthy before comparing against viewedConversationId:
    sx {Boolean(recoveredDraftWarningConversationId) && recoveredDraftWarningConversationId === viewedConversationId && (
  • Ensures the warning is only displayed when an actual draft restoration failed converter restoration (when missingConverterSelections: true sets the destination conversation ID), while keeping empty chats and successful restorations warning-free.
  • Added regression tests in ChatWindow.test.tsx verifying:
    • No converter restoration warning on fresh empty chat with no conversation.
    • No converter restoration warning while fresh chat is loading without an active target.

Tests and Documentation

  • Added unit tests in frontend/src/components/Chat/ChatWindow.test.tsx.
  • Ran Jest test suite:
    • npx jest src/components/Chat/ChatWindow.test.tsx -t "converter restoration warning" (Passed)
  • Ran type-check and linting:
    • npm run type-check (0 errors)
    • npm run lint (0 errors)

@jsong468 Justin Song (jsong468) 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.

Thank you for the contribution!

@jsong468
Justin Song (jsong468) added this pull request to the merge queue Oct 12, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 13, 2026
@jsong468
Justin Song (jsong468) added this pull request to the merge queue Oct 13, 2026
Merged via the queue into microsoft:main with commit 04e3f84 Oct 13, 2026
51 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.

BUG: Empty Chat shows a converter-restoration warning

2 participants