fix(events): make ReactionUpdateEvent counters/total_count optional#69
fix(events): make ReactionUpdateEvent counters/total_count optional#69sau7777 wants to merge 1 commit into
Conversation
On reaction removal the server sends NOTIF_MSG_REACTIONS_CHANGED (OP155) without `counters` (and total_count 0). The model marked both as required, so removal frames raised a ValidationError and failed to dispatch. Default counters to an empty list and total_count to 0 so removal events validate. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughIn ChangesReactionUpdateEvent optional field defaults
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Спасибо за PR но есть пару недочетов |
Problem
ReactionUpdateEventdeclarescountersandtotal_countas required. But when a reaction is removed, the server emitsNOTIF_MSG_REACTIONS_CHANGED(opcode 155) without acountersfield (andtotal_count0):{"chatId": 531302608, "totalCount": 0, "messageId": "116781851510470562"}This raises a
ValidationErrorinEventMapper.map→RuntimeError: Failed to dispatch inbound frame, so reaction-removal events never reachon_reaction_update, and every removal spams the logs with a traceback:Observed live on a linked-device session (real account, June 2026): add a reaction → OP155 with
counters; remove it → OP155 withoutcounters→ crash.Fix
Default
countersto an empty list andtotal_countto0, so removal frames validate cleanly — an emptycounterssimply signals "reaction removed".Notes
counters) are unaffected.counters == []) and a normal add payload (parses counters as before).Summary by CodeRabbit