-
Notifications
You must be signed in to change notification settings - Fork 225
[CI] Sync Mock Server #3823
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
[CI] Sync Mock Server #3823
Conversation
WalkthroughBulk update of StreamChat mock-server JSON fixtures. Changes include new IDs/timestamps, added user/channel fields (e.g., avg_response_time, canBeAddedToGroups, canReceiveMessages, custom_extra_data_key), added member blocks in messages, config flag tweaks (reminders, shared_locations, count_messages), member_count adjustments, message_count additions, device tokens refreshed, and i18n blocks removed. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests
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 |
Generated by 🚫 Danger |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
TestTools/StreamChatTestMockServer/Fixtures/JSONs/http_truncate.json (1)
10-31
: Inconsistent field ordering in user objects.The
created_by
user object has fields in a different order compared to the same user in themembers
array (lines 64-84). For example:
- Lines 25-30:
team
,custom_extra_data_key
,canBeAddedToGroups
,pando
,birthland
,type
- Lines 78-84:
custom_extra_data_key
,type
,team
,pando
,birthland
,canReceiveMessages
,canBeAddedToGroups
While JSON order doesn't affect parsing, consistent field ordering across the same entity improves fixture maintainability and makes diffs easier to review.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (19)
TestTools/StreamChatTestMockServer/Fixtures/JSONs/http_add_member.json
(8 hunks)TestTools/StreamChatTestMockServer/Fixtures/JSONs/http_attachment.json
(1 hunks)TestTools/StreamChatTestMockServer/Fixtures/JSONs/http_channel_creation.json
(10 hunks)TestTools/StreamChatTestMockServer/Fixtures/JSONs/http_channel_removal.json
(8 hunks)TestTools/StreamChatTestMockServer/Fixtures/JSONs/http_channels.json
(11 hunks)TestTools/StreamChatTestMockServer/Fixtures/JSONs/http_events.json
(2 hunks)TestTools/StreamChatTestMockServer/Fixtures/JSONs/http_giphy_link.json
(3 hunks)TestTools/StreamChatTestMockServer/Fixtures/JSONs/http_message.json
(3 hunks)TestTools/StreamChatTestMockServer/Fixtures/JSONs/http_message_ephemeral.json
(5 hunks)TestTools/StreamChatTestMockServer/Fixtures/JSONs/http_reaction.json
(7 hunks)TestTools/StreamChatTestMockServer/Fixtures/JSONs/http_truncate.json
(10 hunks)TestTools/StreamChatTestMockServer/Fixtures/JSONs/http_unsplash_link.json
(4 hunks)TestTools/StreamChatTestMockServer/Fixtures/JSONs/http_youtube_link.json
(3 hunks)TestTools/StreamChatTestMockServer/Fixtures/JSONs/ws_events.json
(3 hunks)TestTools/StreamChatTestMockServer/Fixtures/JSONs/ws_events_channel.json
(13 hunks)TestTools/StreamChatTestMockServer/Fixtures/JSONs/ws_events_member.json
(3 hunks)TestTools/StreamChatTestMockServer/Fixtures/JSONs/ws_health_check.json
(3 hunks)TestTools/StreamChatTestMockServer/Fixtures/JSONs/ws_message.json
(3 hunks)TestTools/StreamChatTestMockServer/Fixtures/JSONs/ws_reaction.json
(3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Automated Code Review
- GitHub Check: Build Test App and Frameworks
- GitHub Check: Metrics
🔇 Additional comments (16)
TestTools/StreamChatTestMockServer/Fixtures/JSONs/ws_reaction.json (1)
1-184
: LGTM! Mock fixture successfully updated with enriched API response structure.The fixture update includes:
- Updated message and channel identifiers with fresh timestamps
- Enriched user objects with additional fields (
avg_response_time
,canBeAddedToGroups
,canReceiveMessages
,custom_extra_data_key
, etc.)- New
member
block (lines 94-128) providing channel membership context- Consistent user data across all nested instances
- Valid JSON structure
The changes align with the API evolution and maintain consistency throughout the fixture.
TestTools/StreamChatTestMockServer/Fixtures/JSONs/http_truncate.json (2)
124-124
: LGTM! Member count matches actual members.The
member_count
of 3 correctly reflects the three members in themembers
array.
200-200
: LGTM! Message count correctly reflects truncated state.The
message_count
of 0 is appropriate for a truncated channel where all previous messages have been removed.TestTools/StreamChatTestMockServer/Fixtures/JSONs/http_youtube_link.json (1)
1-64
: LGTM! Mock fixture updated with expanded user model.The fixture now includes enriched user metadata (avg_response_time, team permissions, custom fields) and a member context object, aligning with an evolved API schema.
TestTools/StreamChatTestMockServer/Fixtures/JSONs/ws_events_member.json (1)
1-54
: LGTM! WebSocket member event fixture updated.The fixture reflects schema evolution with avg_response_time and is_moderator fields replacing the privacy_settings block, and updated channel/user identifiers.
TestTools/StreamChatTestMockServer/Fixtures/JSONs/http_unsplash_link.json (1)
1-63
: LGTM! Fixture updated with expanded user model and refreshed external URLs.The Unsplash link fixture now includes enriched user metadata and a member context, consistent with the schema evolution seen across other fixtures. The updated ixid parameters in image URLs reflect refreshed Unsplash API calls.
TestTools/StreamChatTestMockServer/Fixtures/JSONs/http_events.json (1)
1-32
: LGTM! Typing event fixture updated with expanded user schema.The typing.start event now includes enriched user metadata (avg_response_time, team context, permission flags), consistent with the broader fixture schema evolution.
TestTools/StreamChatTestMockServer/Fixtures/JSONs/ws_health_check.json (2)
1-43
: LGTM! Health check fixture updated with expanded user schema.The fixture now includes enriched user metadata (avg_response_time, team permissions, custom fields), consistent with the schema evolution across all fixtures.
28-30
: Confirm no tests assume zero unread counts. No direct references tounreadCount
,totalUnreadCount
, orunreadChannels
in tests or fixture loading were found—manually verify no implicit zero-unread assumptions in the health_check fixture.TestTools/StreamChatTestMockServer/Fixtures/JSONs/http_message_ephemeral.json (5)
3-3
: LGTM! Expected fixture data refresh.The updated message ID and timestamps are expected for an automated mock server sync operation.
Also applies to: 16-16, 19-19
121-123
: LGTM! Expected mock data refresh.The updated
cid
, timestamps, andduration
values are normal variations for regenerated mock server fixtures.Also applies to: 137-137
37-38
: No changes required for Giphy URL handling
JSONDecoder
generically decodes the newthumb_url
format, and there are no hard-coded dimension or size assertions for Giphy attachments in tests.
21-27
: No changes needed: UserPayload already handles these fields
Theavg_response_time
key maps toavgResponseTime
inUserPayloadsCodingKeys
, and all other new keys (e.g.type
,canReceiveMessages
,canBeAddedToGroups
,custom_extra_data_key
,team
) flow intoextraData
without breaking decoding.
30-32
: Verify MemberRole enum and JSON decoding for new member fieldAlthough
MemberInfoPayload
already maps"channel_role"
tochannelRole
, please confirm that theMemberRole
enum defines the expected case(s) and add a decoding test using thehttp_message_ephemeral.json
fixture to cover the newmember
field.TestTools/StreamChatTestMockServer/Fixtures/JSONs/http_giphy_link.json (2)
20-27
: <!-- [scratchpad]
[task review_file_1/1 section_3_user_model_definition]
[observations]
- Script to find
public struct User
inSources/StreamChat/Models/User.swift
has been requested.
[pending]- Await output to confirm which fields
User
includes.
[actions]- Inspect returned lines for existing properties to verify presence/absence of new fields.
]
29-31
: Confirm nested member.channel_role is decoded into ChatMessage.channelRole and used correctly.Fixture adds "member": { "channel_role": ... } — ChatMessage exposes
public let channelRole: MemberRole?
(Sources/StreamChat/Models/ChatMessage.swift). Verify the decoder mapsmember.channel_role
→channelRole
(init/CodingKeys) and that UI/permission logic readschannelRole
where appropriate.
This PR was created automatically by CI.
Summary by CodeRabbit
New Features
Improvements
Tests