FIX GUI conversation switching during in-flight requests and sort ordering#1517
Merged
adrian-gavrila merged 1 commit intomicrosoft:mainfrom Mar 18, 2026
Conversation
- Replace broad sendingConvIdsRef guard in ChatWindow useEffect with a forceLoadRef mechanism. User-initiated panel clicks set forceLoadRef to bypass the guard, allowing switches to sending conversations. Internal activeConversationId changes from handleSend (e.g., after attack creation) leave forceLoadRef unset so the guard protects optimistic messages from being overwritten by loadConversation. - Normalize naive timestamps from SQLite to UTC before sorting conversations. Raw SQL queries return timezone-naive datetimes while the rest of the codebase uses UTC-aware datetimes, causing TypeError on comparison. - In-flight conversations (no stored messages, created_at=None) now sort to the end using datetime.now(timezone.utc) as fallback, keeping them at the bottom of the list consistently. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
211ebb2 to
f1b6fdf
Compare
riyosha
pushed a commit
to riyosha/PyRIT
that referenced
this pull request
Mar 24, 2026
…ering (microsoft#1517) Co-authored-by: Adrian Gavrila <agavrila@microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
jbolor21
pushed a commit
to jbolor21/jbolor-PyRIT
that referenced
this pull request
Mar 25, 2026
…ering (microsoft#1517) Co-authored-by: Adrian Gavrila <agavrila@microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes two bugs in the frontend conversation panel:
Conversation switching blocked during in-flight requests — A
sendingConvIdsRefguard inChatWindow.tsx'suseEffectprevented loading messages for any conversation with an active send. This was redundant since
loadConversation()already handles in-flight conversations by appending in-flight user messages and a loading spinner. Removed the 3-line guard.In-flight conversations jump position after first response —
attack_service.pysorts conversations bycreated_at, butin-flight conversations have
created_at=None(no stored messages yet), causing them to sort unpredictably. Additionally, SQLite raw queries return timezone-naive datetimes while the rest of the codebase uses UTC-aware datetimes, causingTypeErroron comparison.Fixed by normalizing naive timestamps to UTC in the sort loop and using
datetime.now(timezone.utc)as a fallback forNone, so in-flight conversations consistently sort to the end.Tests and Documentation