[BUG]: Organization filter dropdown in AnalyticsPage renders empty list due to truthy evaluation of empty issuesData

オープン 初心者向け
#476 コメント 5 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@havyasreekuppam がすでに取り組んでいます。

2026年11月22日 から。

  • #477 @shreyapatil22-hub による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
82/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
javascript, react
領域
frontend

調査の方向性

allOrgs の三項演算子は src/pages/AnalyticsPage.jsx の 32 行目にあり、issuesData は src/AppContext.jsx で {} として初期化されています。三項演算子と、"Filter stats by organization" というラベルの付いた 2 つの select 要素を読んでから、src/pages/AnalyticsPage.dropdown.test.jsx を実行してください。issuesData が空の状態で、ドロップダウンに pullsData の組織が表示され、issuesData にデータが入っている場合も引き続き動作すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

bug
Bug Description

In src/pages/AnalyticsPage.jsx (line 32), the organization filter dropdown list (allOrgs) is computed via:

const allOrgs = issuesData ? [...new Set((Object.keys(issuesData)).map(k => k.split('/')[0]))] : [...new Set((Object.keys(pullsData)).map(k => k.split('/')[0]))];

When a user explores organizations and navigates to the Analytics page, issuesData is initialized as an empty object {} in AppContext.jsx (line 22):

const [issuesData, setIssuesData] = useState({})

In JavaScript, an empty object is truthy (Boolean({}) === true). Consequently, the ternary expression unconditionally selects the issuesData branch, evaluating Object.keys({}) which produces [].

The intended fallback to pullsData is completely unreachable dead code. As a result, both the Activity Trends and Advanced Analytics organization filter dropdowns (<select aria-label="Filter stats by organization">) render only <option>All Organizations</option> with zero selectable organizations, preventing users from filtering analytics by organization even when multiple organizations with valid pull requests are loaded.

Steps to Reproduce
  1. Navigate to the Home page and explore one or more organizations (e.g. AOSSIE-Org, Google).
  2. Navigate to the Analytics page (/analytics).
  3. Click on the organization filter dropdown in either the Activity Trends section or the Advanced Analytics section.
  4. Notice that only "All Organizations" is displayed; no individual organizations appear in the dropdown list despite pull request data having been loaded.
Logs and Screenshots

Component test output verifying the bug:

stdout | src/pages/AnalyticsPage.dropdown.test.jsx > AnalyticsPage Organization Filter Dropdown
[FAILURE TEST] Rendered select options with initial issuesData={}: [ 'All Organizations' ]
[CONTROL TEST] Rendered select options with populated issuesData: [ 'All Organizations', 'AOSSIE-Org', 'Google' ]

JSON state representation:

{
  "issuesData": {},
  "pullsData": {
    "AOSSIE-Org/OrgExplorer": [{ "id": 1 }],
    "Google/guava": [{ "id": 2 }]
  },
  "allOrgs": []
}
Environment Details
  • OS: Windows 11 / Linux / macOS
  • Browser: Chrome / Firefox / Safari / Edge
  • Node.js: v20+ / v22+
  • Commit: b396d1b7f50a3341d4a5b9ff67211d95c9a5fb95 (main)
Impact

High - Major feature is broken (Organization filtering is non-functional across Analytics pages)

Code of Conduct
  • I have joined the Discord server and will post updates there
  • I have searched existing issues to avoid duplicates
主要言語
JavaScript
スター
53
フォーク
187
平均マージ
18分
マージ済み PR(30日)
2

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

AOSSIE-Org/OrgExplorer のほかの issue

AOSSIE-Org/OrgExplorer の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。