You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Align the direct parser's nulls and users with the generated models - #6812
The direct (fast) event parser rejected payloads the generated models accept, such as explicit null lists on a message or a poll, so those events fell back to the slower path. It also read event users with own-user fields the generated UserResponse doesn't have.
Message, poll, message.new and channel info accept explicit null and missing keys wherever the generated models do, falling back to the same defaults; message.new takes the channel type and id from cid.
Event users read like the generated user models: a device that isn't an object or has no string id is dropped, and own-user fields (invisible, privacy_settings, unread counts) are no longer read, so they land in extraData as on the generated path. PrivacySettingsAdapter is deleted.
Testing
Parsing tests compare the direct and generated paths on the same payloads, including explicit null and missing keys.
Improved parsing of messages, polls, channel information, and events when optional fields are missing or null, using empty collections or default values where applicable.
Made device parsing more tolerant of unexpected input, while still returning no device when its ID is missing.
Channel type and ID are now derived from the channel identifier when parsing new-message events.
Unrecognized user fields are preserved in extra data.
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
📝 Walkthrough
Direct JSON adapters now tolerate null or missing values for selected message, poll, channel-count, and new-message event fields. The new-message parser derives channel type and ID from cid. Device parsing skips non-object and wrongly typed values and returns null when id is absent. UserAdapter no longer maps privacy, invisibility, and unread-count fields to dedicated User properties. The direct privacy-settings adapter was removed. Tests and fixtures were updated to cover these changes and preserve explicit nulls.
Priority: ⬇️ Low
Merge Risk:⚪ Minimal · up to f1e3d
The change aligns direct parsing with the generated models for nulls, missing keys and user fields. No merge-blocking issues were found.
Pre-merge checks · 4 · 1
Failed checks (1 warning)
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 40 functions across 17 files.
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks (4 passed)
Check name
Status
Explanation
Title check
The title clearly summarizes the main change: aligning direct-parser null handling and user parsing with generated models.
Description check
The description includes the goal, implementation details, linked issue, and testing approach. UI, checklist, reviewer, and GIF sections are omitted, but these are non-critical for this parser-only ch…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
Commit to this branch
Create a new PR
🧪 Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
A rabbit checks the fields at dawn, Nulls hop in, and defaults are drawn. Devices skip what strings are not, Extra data keeps each unhandled spot. The parser nibbles clover, then moves on.
Comment @coderabbitai help to get the list of available commands.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Goal
The direct (fast) event parser rejected payloads the generated models accept, such as explicit
nulllists on a message or a poll, so those events fell back to the slower path. It also read event users with own-user fields the generatedUserResponsedoesn't have.Part of AND-1291
Implementation
message.newand channel info accept explicitnulland missing keys wherever the generated models do, falling back to the same defaults;message.newtakes the channel type and id fromcid.idis dropped, and own-user fields (invisible,privacy_settings, unread counts) are no longer read, so they land inextraDataas on the generated path.PrivacySettingsAdapteris deleted.Testing
Parsing tests compare the direct and generated paths on the same payloads, including explicit
nulland missing keys.🤖 Generated with Claude Code
Summary by CodeRabbit