Skip to content

[BUG]: "Clear All" in Settings doesn't clear the saved analysis, old data comes back after reload #253

Description

@g-k-s-03

Bug Description

Clicking "Clear All" in Settings doesn't fully clear the cache. After clearing and reloading the page, the previous org analysis shows up again without any new API calls.

The Settings page says "Clearing forces fresh API calls on the next explore", but that's not what happens right now.

Looking at IndexedDB, there are two caches:

  • orgexplorer_cache → cache (raw API responses)
  • orgexplorer → analysis (the saved analysis, key "latest")

Clear All only empties the first one. handleClear in SettingsPage.jsx calls cacheClear() from github.js, but clearAnalysis() in src/services/cache.js isn't called anywhere. On reload, loadAnalysis() in AppContext.jsx picks up the leftover "latest" entry and restores everything.

Possible fix: import clearAnalysis in SettingsPage.jsx and call it together with cacheClear() in handleClear.

Steps to Reproduce

  1. Explore an org (I used AOSSIE-Org) and let the analysis load.
  2. Go to Settings → Data Cache and click Clear All.
  3. Open DevTools → Application → IndexedDB and refresh both stores:
    • orgexplorer_cache/cache → 0 entries
    • orgexplorer/analysis → still has "latest"
  4. Open DevTools → Network, filter by api.github.com, go to Overview and reload.
  5. The old analysis is shown again, with 0 requests to api.github.com, and the rate limit counter doesn't change.

Expected: Clear All clears both caches, so the next load fetches fresh data.

Logs and Screenshots

Before clearing: cache store has 12 entries

cache store before clearing

After Clear All: cache store is empty

cache store empty after Clear All

After Clear All: analysis store still has "latest"

analysis store still populated after Clear All

After reload: old analysis restored, 0 / 124 requests to api.github.com, quota unchanged (51/60)

analysis restored after reload with no API requests

Environment Details

  • Upstream main at 42f1ef9
  • Microsoft Edge on Windows 11
  • Local dev server (npm run dev)
  • Standard Analysis (no PAT)

Impact

Medium - Feature works but has issues

Code of Conduct

  • I have joined the Discord server and will post updates there
  • I have searched existing issues to avoid duplicates

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions