Fix fast event parser routing mention flags into extraData instead of typed fields#6528
Fix fast event parser routing mention flags into extraData instead of typed fields#6528gpunto wants to merge 1 commit into
Conversation
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
4e8aa75 to
ee48bf0
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
SDK Size Comparison 📏
|
WalkthroughDirect message parsing now includes user-group adapters and new mention metadata fields. Parser tests and fixtures were updated to construct the added adapters and cover the expanded message shape. ChangesUser-group adapters and direct wiring
Direct message mention fields
Sequence Diagram(s)sequenceDiagram
participant DirectEventParser
participant UserGroupMemberAdapter
participant UserGroupAdapter
participant MessageAdapter
DirectEventParser->>UserGroupMemberAdapter: create lazy adapter
DirectEventParser->>UserGroupAdapter: create lazy adapter with member adapter and dateAdapter
DirectEventParser->>MessageAdapter: pass userGroupAdapter
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 PMD (7.25.0)stream-chat-android-client/src/main/java/io/getstream/chat/android/client/parser2/direct/UserGroupMemberAdapter.ktNo java executable found in PATH 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@stream-chat-android-client/src/main/java/io/getstream/chat/android/client/parser2/direct/MessageAdapter.kt`:
- Around line 129-132: Check the explicit-null behavior for the new mention
fields in MessageAdapter against DownstreamMessageDto and make them consistent.
Verify whether mentioned_here, mentioned_channel, mentioned_groups, and
mentioned_roles are nullable or non-null in the DTO; if any are non-null, update
the direct parser to reject explicit nulls like the DTO path does instead of
using readNullableBoolean/parseList/parseStringList. Keep the parsing parity
aligned with the existing patterns used for pinned, silent, thread_participants,
and i18n, and reference MessageAdapter plus DownstreamMessageDto when making the
change.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 97ca36f5-0969-4489-8b03-71a141400934
📒 Files selected for processing (7)
stream-chat-android-client/src/main/java/io/getstream/chat/android/client/parser2/DirectEventParser.ktstream-chat-android-client/src/main/java/io/getstream/chat/android/client/parser2/direct/MessageAdapter.ktstream-chat-android-client/src/main/java/io/getstream/chat/android/client/parser2/direct/UserGroupAdapter.ktstream-chat-android-client/src/main/java/io/getstream/chat/android/client/parser2/direct/UserGroupMemberAdapter.ktstream-chat-android-client/src/test/java/io/getstream/chat/android/client/parser2/MessageParsingTest.ktstream-chat-android-client/src/test/java/io/getstream/chat/android/client/parser2/NewMessageEventParsingTest.ktstream-chat-android-client/src/test/java/io/getstream/chat/android/client/parser2/testdata/MessageTestData.kt
2eb085b to
acf10d7
Compare
acf10d7 to
cbdf29e
Compare
|



Goal
The opt-in fast event parser (
MessageAdapterinparser2/direct, used byDirectEventParserformessage.new) has no cases for the always-presentmentioned_here,mentioned_channel,mentioned_groups, andmentioned_roleswire keys. They fall through to theelsebranch and land inMessage.extraData.Closes AND-1272
Implementation
whencases inMessageAdapter, mapping them to the same domain fields and defaults as the DTO path.UserGroupAdapterto parsementioned_groups, wired throughDirectEventParser.Testing
mentioned_groups) so the existing DTO-path vs direct-path parity tests now exercise the fix../gradlew :stream-chat-android-client:testDebugUnitTestpasses.Summary by CodeRabbit
New Features
Bug Fixes
Tests