[BUG]: fetchContributors, fetchIssues, and fetchPulls crash with "TypeError: data is not iterable" when GitHub API returns non-array objects
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- github, javascript
Research direction
Start in src/services/github.js, reviewing fetchWithCache() around lines 55-83 and the fetchContributors(), fetchIssues(), and fetchPulls() pagination logic around lines 101-135. Reproduce the issue with disabled-issue, empty, restricted, or 204-response repositories, then verify the pipeline completes without JSON or iterable errors and returns empty results where appropriate.
Written by the indexing model from the issue text.
Description
Bug Description
In src/services/github.js, fetchContributors(), fetchIssues(), and fetchPulls() spread the response from fetchWithCache() directly into an array using all.push(...data).
However, several GitHub API endpoints return non-array JSON objects or 204 No Content responses under valid conditions:
- Querying issues for repositories where issues are disabled returns
{ "message": "Issues are disabled in this repository" }. - Querying contributors for empty repositories returns
{ "message": "Git Repository is empty." }or HTTP 204 No Content. - Querying restricted repositories returns warning/error payload objects.
When data is a non-array object, all.push(...data) throws an uncaught JavaScript error:
TypeError: data is not iterable (or SyntaxError: Unexpected end of JSON input), causing the data fetching pipeline to crash and stall.
Where the Bug Occurs
src/services/github.js(lines 55-83):fetchWithCacheattemptsres.json()on 204 No Content responses without checking status.src/services/github.js(lines 101-135):fetchContributors(),fetchIssues(), andfetchPulls()executeall.push(...data)without validatingArray.isArray(data).
Expected Behavior
fetchWithCache()should handle 204 No Content responses gracefully (e.g. returning[]).fetchContributors(),fetchIssues(), andfetchPulls()should checkif (Array.isArray(data))before spreading intoall.push(...data), and break gracefully ifdatais not an array.
Steps to Reproduce
- Run
explore()on an organization that has repositories with disabled issues or empty repositories. - Observe the browser console.
- The fetch pipeline encounters
TypeError: data is not iterableand fails to complete analytics aggregation.
Note
Please do not post AI-generated spam or generic template comments on this issue.
Logs and Screenshots
No response
Environment Details
No response
Impact
High - Major feature is broken
Code of Conduct
- I have joined the Discord server and will post updates there
- I have searched existing issues to avoid duplicates
- I am ready to submit a pr for this issue
- 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 84/100
AOSSIE-Org/OrgExplorer#228 · 2 comments ·
-
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 ·
-
[Block] Latest Posts [Type] Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
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 ·