[bug]: Assignee distribution in cycle/module analytics counts soft-deleted assignees and inflates totals
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 70/100
Hướng nghiên cứu
Start with the assignee aggregation in CycleAnalyticsEndpoint in apps/api/plane/app/views/cycle/base.py, then check the matching blocks in cycle/archive.py, module/base.py and analytic/project_analytics.py. The join on issue_assignees needs a deleted_at IS NULL filter, and the count needs to be distinct per work item rather than per row. Done means the Assignees breakdown matches the filtered work item list for the same cycle, with a regression test covering a soft-deleted reassignment.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Is there an existing issue for this?
- I have searched the existing issues
(Closest I found: #8868, same root cause in the profile endpoint.)
Current behavior
The "Assignees" breakdown of a cycle (active cycle page, /cycles/<id>/analytics/, archived cycles) and of a module reports more work items per assignee than the assignee really has. The numbers don't match the filtered work item list of the same cycle.
Example from a self-hosted instance (cycle with 102 work items, one assignee):
- Assignees panel: 69 work items (27 completed, 42 pending)
- Work item list filtered by that assignee: 47 (18 completed, 29 pending)
Other assignees in the same cycle are inflated too (e.g. 19 vs 8, 31 vs 16).
Cause: the assignee aggregation joins issue_assignees without filtering deleted_at IS NULL, and counts rows (Count("assignee_id")) instead of distinct work items. Every soft-deleted assignment (unassign/reassign, bulk edits, imports) is counted again. In this example there are 22 soft-deleted rows in the cycle, which is exactly 69 − 47.
Affected code (v1.4.2, same pattern still on preview): CycleAnalyticsEndpoint in apps/api/plane/app/views/cycle/base.py, and the equivalent assignee aggregations in cycle/archive.py, module/base.py and analytic/project_analytics.py.
What I expect: the breakdown counts only active assignments, one per distinct work item, matching the filtered list.
Steps to reproduce
- Create a cycle with a few work items.
- Assign a work item to user A, then unassign and reassign it a few times (each removal leaves a soft-deleted
issue_assigneesrow). - Open the cycle page and look at user A's count in the Assignees breakdown.
- Filter the cycle's work items by user A: the breakdown is higher.
SQL check: counting issue_assignees rows for the cycle and the user returns more rows than the same query with and ia.deleted_at is null.
Environment
Production
Browser
Other
Variant
Self-hosted
Version
v1.4.2
I have a fix with a regression test and will open a PR.
- Ngôn ngữ chính
- TypeScript
- Star
- 63k
- Fork
- 6.5k
- Merge trung bình
- 2 ngày 16 giờ
- Pull request đã merge (30 ngày)
- 70
Chuẩn bị môi trường
- Có Dockerfile hoặc 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 makeplane/plane
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[bug]: Comment external_id is deduplicated per project instead of per work itemCó thể đã có người làm @MishraTanishq619 đã nhận 21 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
makeplane/plane#10195 · 2 bình luận ·
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 1 ngày
-
Missing optional chaining on actor_details and reaction_items in apps/space reactions and votesCó thể đã có người làm @ghazy2001 đã nhận 29 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
makeplane/plane#10111 · 2 bình luận ·
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 85/100
makeplane/plane#10082 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của makeplane/plane
Issue tương tự
-
good first issue help wanted
Độ khó 2/5 Dưới một giờ Mức phù hợp với người mới 86/100
Intelligenza-Umana/intelligenza-umana-web#16 ·
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 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
open-webui/open-webui#35184 · 1 bình luận ·
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 76/100
danielmiessler/LifeOS#3001 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày