I'm Not on the DEV Team. I Still Debugged Their Missing Badges From Public Code. (And My First Test Was Wrong.)
说明与用途
DEV徽章颁发系统的错误(slug不匹配、缺少感谢信息、无幂等性)已修复。合并四个或更多PR的用户现在会收到4x‑commit‑club徽章,并附带感谢信息且不会重复颁发。
问题
Multi‑commit contributor badges were never awarded because badge slugs in production did not match the hard‑coded constants, context messages were omitted, and idempotency was missing.
结果
Badge awarding logic corrected; users now receive multi‑commit badges with proper thank‑you messages and no duplicate notifications.
工作流
- 1. Observe missing badge after merging 4 PRs.
- 2. Inspect BadgeAwardWorker schedule and GitHub API to confirm contributions.
- 3. Open award_contributor_from_github.rb and compare single vs multi‑commit logic.
- 4. Identify three bugs: silent slug drops, missing context messages, missing idempotency guard.
- 5. Create Issue #24114 and PR #24113 to fix the service.
- 6. Review PR with OpenHands, confirm diagnosis and fix logging.
- 7. Merge PR, badge awarded, thank‑you message displayed.
证据
Each key in BADGE_SLUGS is resolved via Badge.id_for_slug(slug). If a slug in the production badges table doesn't match the hardcoded constant, id_for_slug returns nil.
Even when a multi-commit badge was created, it omitted rewarding_context_message_markdown: msg.
create_badges_for_user called BadgeAchievement.create on every hourly run instead of .where(...).first_or_create(...).
- 记录日期: 2026-10-24T19:11:21.992Z