fix(shared): accept system-authored users (role: "system", null email) in UserSchema#2
fix(shared): accept system-authored users (role: "system", null email) in UserSchema#2obiyoda wants to merge 1 commit into
Conversation
The Fizzy API returns a 'system' role with a null email_address for system-authored content (e.g. the automated "moved to column" comment added when a card is triaged). UserSchema only allowed owner/admin/member and a non-null email, so any list_comments response containing a system comment failed Zod validation and the whole call threw — making such threads unreadable via the MCP server. Allow role 'system' and a nullable email_address.
|
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)
📝 WalkthroughWalkthroughThe ChangesUser Schema Updates
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 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 |
Problem
The Fizzy API returns a user with
role: "system"andemail_address: nullfor system-authored content — notably the automated "moved to column" comment that gets added whenever a card is triaged/moved.UserSchema(inpackages/shared/src/schemas/common.ts) only permitsowner | admin | memberand a non-null.email()address. So as soon as a card's comment list contains any system-authored comment,list_commentsfails Zod validation on that entry and the entire response throws — the thread becomes unreadable through the MCP server. In practice this hits every card an agent has moved between columns.Observed error:
Fix
Two-line change to
UserSchema:'system'to theroleenumemail_addressnullableThis unblocks reading any comment thread that includes system-authored comments, with no impact on human-authored users.
Summary by CodeRabbit