[BUG]: Organization filter dropdown in AnalyticsPage renders empty list due to truthy evaluation of empty issuesData
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 82/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript, react
- Lĩnh vực
- frontend
Hướng nghiên cứu
Toán tử ba ngôi allOrgs nằm ở dòng 32 của src/pages/AnalyticsPage.jsx, còn issuesData khởi tạo là {} trong src/AppContext.jsx. Hãy đọc toán tử ba ngôi và hai phần tử select có nhãn "Lọc thống kê theo tổ chức", rồi chạy src/pages/AnalyticsPage.dropdown.test.jsx. Công việc hoàn thành khi danh sách thả xuống hiển thị các tổ chức từ pullsData trong lúc issuesData rỗng, và trường hợp issuesData đã có dữ liệu vẫn hoạt động bình thường.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- JavaScript
- Star
- 53
- Fork
- 187
- Merge trung bình
- 18 phút
- Pull request đã merge (30 ngày)
- 2
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của AOSSIE-Org/OrgExplorer
-
Add Pat for 5000 req/hr button not visible when pat expiresCó thể đã có người làm @Rajvardhan-Singh-Rathore đã nhận 6 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
AOSSIE-Org/OrgExplorer#473 · 6 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG]: PAT popup input lacks label association and visibility button lacks an accessible nameCó thể đã có người làm @prasanm1423 đã nhận 10 ngày trước. Đang mởbug enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
AOSSIE-Org/OrgExplorer#466 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[FEATURE]: Set dynamic document.title based on active page routeCó thể đã có người làm @23241a6749 đã nhận 8 ngày trước. Đang mởenhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
AOSSIE-Org/OrgExplorer#462 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG]: SocialShareButton logs unconditional console.warn when script is not loadedCó thể đã có người làm @vivekrajputofficial29-afk đã nhận 8 ngày trước. Đang mởbug enhancement
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 89/100
AOSSIE-Org/OrgExplorer#461 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG]: governance page shows "No dead issues" before the audit has runCó thể đã có người làm @SHIVIKA330 đã nhận 5 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
AOSSIE-Org/OrgExplorer#453 · 5 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của AOSSIE-Org/OrgExplorer
Issue tương tự
-
marketing
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Kanevry/session-orchestrator#108 ·
-
PHP 8.6: "Returning a value from a constructor is deprecated" in app/Common/Models/Model.phpĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
awesomemotive/all-in-one-seo-pack#3238 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
andromarces/agent-loops#2055 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 2 ngày