[BUG]: Cache key ignores auth state, causing stale contributor data after adding PAT
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 84/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- github, javascript
Research direction
Start in src/services/github.js at fetchWithCache(), then trace its use from fetchOrg, fetchRepos, fetchContributors, fetchIssues, and fetchPulls. Reproduce the unauthenticated-then-authenticated sequence described in the issue and inspect cacheGet/cacheSet behavior. Done means page=1 is fetched again after a PAT is added instead of being served from the unauthenticated cache.
Written by the indexing model from the issue text.
Description
Bug Description
fetchWithCache() in src/services/github.js caches responses using only the URL as key, ignoring pat. Since fetchContributors uses maxPages = pat ? 10 : 1, page=1 has the same URL whether authenticated or not. Once page=1 is cached without a PAT, adding a PAT later silently returns the old cached page=1 instead of re-fetching with auth. Affects fetchOrg, fetchRepos, fetchContributors, fetchIssues, fetchPulls.
Steps to Reproduce
- Without a PAT, explore an org (e.g. AOSSIE-Org) — caches page=1 contributors for each repo.
- Add a PAT in Settings, Save.
- Explore the same org again.
- In DevTools → Network, filter by a repo already explored in step 1 (e.g. "Website").
- page=1 shows no new request (served from cache); only page=2, page=3... appear as fresh requests.
Logs and Screenshots
async function fetchWithCache(url, pat) {
const cached = await cacheGet(url) // <-- pat ignored here
if (cached) return cached
...
const data = await res.json()
cacheSet(url, data) // <-- pat ignored here too
return data
}
Environment Details
No response
Impact
Critical - Application is unusable
Code of Conduct
- I have joined the Discord server and will post updates there
- I have searched existing issues to avoid duplicates
- Dominant language
- JavaScript
- Stars
- 35
- Forks
- 98
- Avg merge
- 4d 14h
- Merged PRs (30d)
- 12
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from AOSSIE-Org/OrgExplorer
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
AOSSIE-Org/OrgExplorer#245 · 1 assignee ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
AOSSIE-Org/OrgExplorer#230 · 2 comments ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
AOSSIE-Org/OrgExplorer#225 · 1 comment ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
AOSSIE-Org/OrgExplorer#216 ·
-
bug
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
AOSSIE-Org/OrgExplorer#211 · 2 comments ·
All issues in AOSSIE-Org/OrgExplorer
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
sugarlabs/musicblocks#8847 ·
-
client-controller-update ta-bot-triage team-money-movement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
MetaMask/metamask-mobile#36594 ·