Skip to content

Site Audit: deleting an audit leaves the trend card and quota counter stale #669

Closed

Description

@gkhngyk

Problem

handleDelete on the hub only updates the history list optimistically (setHistory). The trend card and quota counter are populated by a separate effect keyed on [activeBrandId, refreshKey], which delete never touches. So after deleting the most recent primary-domain audit, the big score, its delta, the chart, and the category bars all keep showing the deleted audit — the list and the card sit on screen contradicting each other until a full page refresh. The quota counter goes stale the same way.

Evidence

Distinct from #614 (which is about the missing delete confirmation).

Fix

After a successful deleteAudit, trigger the existing refetch() so trend and quota reflect reality (keep the optimistic list update for responsiveness).

Acceptance criteria

  • Deleting the newest audit updates the score card, chart, and delta without a page reload.
  • A failed delete still restores the list (current behavior preserved).

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