Skip to content

fix: prevent concurrent analysis requests#697

Open
charu2210 wants to merge 1 commit into
imDarshanGK:mainfrom
charu2210:fix-keyboard-shortcut-spam
Open

fix: prevent concurrent analysis requests#697
charu2210 wants to merge 1 commit into
imDarshanGK:mainfrom
charu2210:fix-keyboard-shortcut-spam

Conversation

@charu2210
Copy link
Copy Markdown

Summary

Fixes issue #423 by preventing multiple concurrent analysis requests from being triggered through repeated keyboard shortcut presses (Ctrl/Cmd + Enter).

Changes Made

  • Added an isAnalyzing state flag to track active analysis requests.
  • Added a guard in the keyboard shortcut handler to ignore repeated triggers while an analysis is already running.
  • Added a guard inside runAnalysis() to prevent overlapping requests from any entry point.
  • Reset the analysis state after request completion in the finally block.

Why

Previously, repeated use of the analysis keyboard shortcut could invoke runAnalysis() multiple times before the existing request completed, potentially resulting in duplicate requests and inconsistent UI behavior.

Issue

Closes #423

@charu2210 charu2210 requested a review from imDarshanGK as a code owner May 30, 2026 16:20
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] Multiple concurrent analysis requests can be triggered via keyboard shortcut spam

1 participant