Skip to content

Retry (and Analyze) still upload a dump removed from the page while the session check is pending #380

Open

Description

@faratech

Summary

retryFile() captures fileToRetry, awaits initializeSession(true) (seconds when Turnstile re-verifies), then flips the file to ANALYZING and calls analyzeDumpFiles([retryDumpFile]) without checking the file is still on the page. The failed card keeps its Remove button and "Clear finished results" during that await, so Retry followed by Remove/Clear still uploads and analyzes the dump: WinDBG upload slot and AI quota spent, orphan progress shown, the result discarded. analyzeFiles() has the same window for pending files removed from the preview list while it awaits the session.

Impact

Wasted cost-bearing quota (WinDBG upload, AI tokens) and a dump uploaded after the user removed it from the page, which they would reasonably expect to cancel it.

Evidence

  • hooks/useAnalysis.tsx:152-199 capture, await initializeSession(true), then status flip and analyzeDumpFiles with no presence check.
  • hooks/useAnalysis.tsx:48-71 analyzeFiles filters PENDING files before the same await and marks them only after it.
  • components/AnalysisResults.tsx:33-34,56 Remove is offered for every ERROR/ANALYZED card; pages/Analyzer.tsx:96-102 Clear keeps only PENDING/ANALYZING.
  • Finder repro in jsdom with stubbed geminiProxy / sessionManager.

Fix direction

Mark the file(s) ANALYZING before awaiting the session (not after), so the card is no longer "finished" (Remove hidden, Clear keeps it, the pending preview no longer offers its remove) for the whole retry/analysis; on a failed session check put them back (retry: ERROR as before; analyze: PENDING). Simpler and more robust than cancelling an in-flight upload.

Verification

  • New jsdom test driving useAnalysis with stubbed analyzeDumpFiles / initializeSession: during the session await the file is ANALYZING (not removable); session failure restores it; analyzeDumpFiles is called with exactly the files still present.
  • npm test, npx tsc --noEmit, npm run build.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingsev:lowLow severity

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions