Skip to content

Site Audit detail: Re-run has no pending state — a double click starts two audits and burns quota twice #667

Closed

Description

@gkhngyk

Problem

The detail page's re-run button calls handleRefresh which awaits runAudit and navigates — but sets no pending state, and the button has no disabled. The server responds 202 immediately and runs the audit in the background, and quota is written per completed audit. So on a slow network, a user who clicks twice (because nothing visibly happened) starts two audits and spends two units of their monthly Site Audit quota.

The hub page already guards the identical operation with a running state and disabled={running || quotaExhausted}.

Evidence

Fix

Add a rerunning state: set it before runAudit, bind disabled={rerunning}, and swap the icon for a spinning Loader2 while pending — the hub pattern verbatim.

Acceptance criteria

  • Double-clicking Re-run starts exactly one audit.
  • The button visibly indicates the pending request.

Activity

  1. added
    bug
    good first issue
    on Aug 7, 2026
  2. BharadwajKanneveti commented on Aug 7, 2026

    @BharadwajKanneveti
    Contributor

    hi @gkhngyk I will work on this issue

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

    buggood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions