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

Đang mở Phù hợp với người mới
#476 5 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@havyasreekuppam đang làm issue này rồi.

Từ ngày 22/11/2026.

  • #477 của @shreyapatil22-hub — đang mở

Đá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
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
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

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của AOSSIE-Org/OrgExplorer

Tất cả issue của AOSSIE-Org/OrgExplorer

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.