I'm Not on the DEV Team. I Still Debugged Their Missing Badges From Public Code. (And My First Test Was Wrong.)
Description and use
A bug in DEV’s badge awarding system—slug mismatch, missing thank‑you message, and lack of idempotency—was fixed. Users who merged four or more PRs now receive the 4x‑commit‑club badge with a thank‑you note and no duplicate awards.
Problem
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.
Outcome
Badge awarding logic corrected; users now receive multi‑commit badges with proper thank‑you messages and no duplicate notifications.
Workflow
- 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.
Evidence
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(...).
- Record date: 2026-10-24T19:11:21.992Z