Skip to content

fix: debounce modal open and guard duplicate analyze triggers#1092

Open
ananyashree2633 wants to merge 13 commits into
imDarshanGK:mainfrom
ananyashree2633:fix-modal-race-condition
Open

fix: debounce modal open and guard duplicate analyze triggers#1092
ananyashree2633 wants to merge 13 commits into
imDarshanGK:mainfrom
ananyashree2633:fix-modal-race-condition

Conversation

@ananyashree2633

@ananyashree2633 ananyashree2633 commented Jun 21, 2026

Copy link
Copy Markdown

Description

Fix rapid double-click on Analyze button causing duplicate API calls and inconsistent state/crash.

Related Issue

Fixes #539

Type of change

  • [✅ ] Bug fix
  • New feature / enhancement
  • Documentation update
  • [ ✅] Test addition
  • Refactor

Checklist

  • [ ✅] I have read CONTRIBUTING.md
  • [ ✅] My branch is up to date with main
  • [✅ ] I have run pytest -v and all tests pass
  • [✅ ] I have not introduced duplicate issues or features
  • [✅ ] My PR title follows the format: feat/fix/docs/test: short description
  • [✅ ] I have added tests for new features (Level 2 and 3 issues)
  • [✅ ] No hardcoded secrets or API keys in my code
  • [✅ ] This PR is linked to a GSSoC 2026 issue

Screenshots (if frontend

Screen Recording 2026-06-22 at 1.24.40 AM.mov.zip

Test evidence

PASSED tests/test_endpoints.py::test_analyze_concurrent_calls_idempotent
===================================== 56 passed, 1 warning in 0.29s =====================================

@imDarshanGK imDarshanGK left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

@ananyashree2633
Please add a video demo of the feature
Image

@ananyashree2633

ananyashree2633 commented Jun 21, 2026

Copy link
Copy Markdown
Author

Hi @imDarshanGK,

Locally all black and isort checks pass:

  • git diff --name-only origin/main...HEAD -- '*.py' | xargs black --check ✅ 22 files unchanged
  • git diff --name-only origin/main...HEAD -- '*.py' | xargs isort --check-only

The failing CI run shows "failed 1 hour ago in 7s" which appears to be a cached old run. Could you please re-run the CI checks? Thank you!

@ananyashree2633 ananyashree2633 left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

All changes implemented and tested:

  • Added isAnalyzing guard flag
  • Added debounce on analyze button
  • Added regression test
  • All 56 tests passing
  • Video demo added

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.

Fix UI race condition when opening modal twice

2 participants