[BUG]: Organization filter dropdown in AnalyticsPage renders empty list due to truthy evaluation of empty issuesData
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 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 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
- Navigate to the Home page and explore one or more organizations (e.g.
AOSSIE-Org,Google). - Navigate to the Analytics page (
/analytics). - Click on the organization filter dropdown in either the Activity Trends section or the Advanced Analytics section.
- 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
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
AOSSIE-Org/OrgExplorer のほかの issue
-
Add Pat for 5000 req/hr button not visible when pat expires対応中かも @Rajvardhan-Singh-Rathore が 6 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
AOSSIE-Org/OrgExplorer#473 · コメント 6 件 ·
メンテナーはふだん 1 日以内に返信
-
[BUG]: PAT popup input lacks label association and visibility button lacks an accessible name対応中かも @prasanm1423 が 10 日前に担当しました。 オープンbug enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
AOSSIE-Org/OrgExplorer#466 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
[FEATURE]: Set dynamic document.title based on active page route対応中かも @23241a6749 が 8 日前に担当しました。 オープンenhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
AOSSIE-Org/OrgExplorer#462 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
[BUG]: SocialShareButton logs unconditional console.warn when script is not loaded対応中かも @vivekrajputofficial29-afk が 8 日前に担当しました。 オープンbug enhancement
難易度 1/5 1時間未満 初心者へのやさしさ 89/100
AOSSIE-Org/OrgExplorer#461 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[BUG]: governance page shows "No dead issues" before the audit has run対応中かも @SHIVIKA330 が 5 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
AOSSIE-Org/OrgExplorer#453 · コメント 5 件 ·
メンテナーはふだん 1 日以内に返信
AOSSIE-Org/OrgExplorer の issue をすべて見る
似ている issue
-
marketing
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
Kanevry/session-orchestrator#108 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
awesomemotive/all-in-one-seo-pack#3238 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
andromarces/agent-loops#2055 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 2 日以内に返信