You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 24, 2026. It is now read-only.
When Blazor re-renders (triggered by OnStateChanged), the draft restore system (restoreDraftsAndFocus) can overwrite whatever the user is currently typing with a stale draft from draftBySession.
Steps to reproduce
Send a message (e.g., /prompt use PR Review -- 559) in a session
The message is sent and the textarea clears
Type a new message
A Blazor re-render fires (from any state change)
The textarea is overwritten with the OLD message (/prompt use PR Review -- 559)
Root cause
draftBySession retains the old draft text. The JS-side __liveDrafts mechanism captures live input and merges it before restore, but there's a race window: if the render happens between send (textarea cleared) and the next input event, the stale draft wins.
Problem
When Blazor re-renders (triggered by
OnStateChanged), the draft restore system (restoreDraftsAndFocus) can overwrite whatever the user is currently typing with a stale draft fromdraftBySession.Steps to reproduce
/prompt use PR Review -- 559) in a session/prompt use PR Review -- 559)Root cause
draftBySessionretains the old draft text. The JS-side__liveDraftsmechanism captures live input and merges it before restore, but there's a race window: if the render happens between send (textarea cleared) and the nextinputevent, the stale draft wins.Relevant code
PolyPilot/wwwroot/index.html:687-787—restoreDraftsAndFocusPolyPilot/Components/Pages/Dashboard.razor:1167-1175,1209-1231— draft save/restore