Stats: Tags and Categories details crashes when two expanded groups share a tag
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue nà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
- 76/100
Hướng nghiên cứu
Bắt đầu với StatsDataHelper.swift, đặc biệt là childRowsForItems và expandableDataRowsFor, sau đó kiểm tra tính bằng nhau của DetailExpandableChildRow và bản sửa lỗi cho issue #26415. Tái hiện lỗi với hai nhóm tag dùng chung một tag và có ít nhất bảy mục, rồi mở rộng cả hai nhóm trong thẻ Tags and Categories kiểu cổ điển. Hoàn tất khi cả hai nhóm mở rộng mà không bị crash và các phần có thể mở rộng liên quan vẫn hoạt động chính xác.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
The app crashes when you expand two groups in the classic Insights → Tags and Categories → View more screen that share a tag. We reproduced it on an iOS 27.2 simulator using stats data served from a local proxy. None of the crash reports Sentry still keeps for this crash signature (JETPACK-IOS-1ASW) come from this screen, so we don't know how many users hit it.
Who hits it
Anyone whose top tags include two groups with a tag in common. The Stats API groups tags that appear together on a post, so a site with posts tagged "news, tech" and "news, sport" shows two groups that both contain "news". Expanding both crashes the app.
Why
The expanded tag rows only hold the tag's name, an empty count and its URL. Nothing ties a row to the group it's in, so the two "news" rows are equal, and the diffable table rejects them as duplicate items (NSInternalInconsistencyException: "supplied item identifiers are not unique"). The rows are built by childRowsForItems:
#26415 fixes the same crash for Post Stats month rows, which is the case behind all retained Sentry reports, but it does not cover tags.
Fix
- Make each expanded child row include its parent row's identity (for example the parent's
nameandstatSection) inDetailExpandableChildRowequality, set inexpandableDataRowsFor. - That one change covers every expandable section built there: tags, months, and possibly Authors (a co-authored post under two authors) and repeated Clicks or Referrers entries. Those last cases have not been reproduced.
How to reproduce
- Use a site whose stats return two tag groups sharing a tag (for example "news, tech" and "news, sport") and at least seven entries, so the card shows View more.
- With New Stats turned off, open Insights, add the Tags and Categories card if needed, and tap View more.
- Expand "news, tech", then "news, sport". The app crashes.
Crash log from the simulator (Jetpack Debug, built from #26415)
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Fatal: supplied item identifiers are not unique. Duplicate identifiers: {(
WordPress.AnyHashableImmuTableRow(immuTableRow: WordPress.DetailExpandableChildRow(rowData: WordPress.StatsTotalRowData(id: nil, name: "news", data: "", ..., showDisclosure: true, disclosureURL: Optional(https://jkmassel.wordpress.com/tag/news/), multiline: true, childRows: Optional([]), statSection: nil, isReferrerSpam: false, month: nil), ..., hideIndentedSeparator: true, hideFullSeparator: true, ...))
)}'
The tags response the proxy served:
{"tags": [
{"views": 20, "tags": [{"name": "news", "type": "tag"}, {"name": "tech", "type": "tag"}]},
{"views": 10, "tags": [{"name": "news", "type": "tag"}, {"name": "sport", "type": "tag"}]},
{"views": 9, "tags": [{"name": "filler0", "type": "tag"}]},
"... five more single-tag entries"
]}
- Ngôn ngữ chính
- Swift
- Star
- 3.9k
- Fork
- 1.2k
- Merge trung bình
- 1 ngày 21 giờ
- Pull request đã merge (30 ngày)
- 126
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 wordpress-mobile/WordPress-iOS
-
Bug iOS Reader
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
wordpress-mobile/WordPress-iOS#26423 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Pri] Low [Status] Ready for Dev [Type] Bug /Me
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
wordpress-mobile/WordPress-iOS#26279 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Pri] Low [Status] Ready for Dev [Type] Bug Share Extension
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
wordpress-mobile/WordPress-iOS#26276 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Pri] Low [Status] Ready for Dev [Type] Bug Blogging Prompts Notifications
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
wordpress-mobile/WordPress-iOS#26256 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Status] Ready for Dev [Type] Bug Reader
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
wordpress-mobile/WordPress-iOS#26254 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của wordpress-mobile/WordPress-iOS
Issue tương tự
-
Dead space between sidebar iconsĐang mởbug mac
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 63/100
VictorKildahl/cra#818 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Feature] 自定义动作输入效果较差Có thể đã có người làm @zo-no đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 74/100
-
chore
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
lugassawan/swe-workbench#841 ·
-
IINA quits at launch when `input_conf` is a symlink, and loads no plugins when `plugins` is oneCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ 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