Skip to content

Conversation

Stream-SDK-Bot
Copy link
Collaborator

@Stream-SDK-Bot Stream-SDK-Bot commented Oct 1, 2025

This PR was created automatically by CI.

Summary by CodeRabbit

  • New Features

    • Enabled share location capability and user message reminders; added channel flags (shared locations, count messages) and message_count.
    • Messages and reactions now include member context and richer user metadata (avg response time, moderator status).
    • Refreshed media/link previews for Giphy, Unsplash, and YouTube.
  • Improvements

    • Updated IDs/timestamps and normalized activity fields across channels, messages, and events.
    • WebSocket health check now surfaces unread counts.
  • Tests

    • Overhauled mock server fixtures to reflect new capabilities, expanded user fields, updated counts, and consistent payload structures.

@Stream-SDK-Bot Stream-SDK-Bot requested a review from a team as a code owner October 1, 2025 00:18
Copy link

coderabbitai bot commented Oct 1, 2025

Walkthrough

Bulk 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

Cohort / File(s) Summary
HTTP Channel Lifecycle
TestTools/StreamChatTestMockServer/Fixtures/JSONs/http_add_member.json, .../http_channel_creation.json, .../http_channel_removal.json, .../http_channels.json, .../http_truncate.json
Updated channel IDs/cids and timestamps; member_count decreased; config updated (reminders true; added user_message_reminders, shared_locations, count_messages); added message_count; expanded user/member fields (avg_response_time, canReceiveMessages, canBeAddedToGroups, custom_extra_data_key, is_moderator); removed private_settings; durations adjusted.
HTTP Message & Media Fixtures
.../http_message.json, .../http_message_ephemeral.json, .../http_reaction.json, .../http_giphy_link.json, .../http_unsplash_link.json, .../http_youtube_link.json, .../http_attachment.json
Message IDs/cids/timestamps refreshed; introduced member block (channel_role); expanded user payloads (avg_response_time, capabilities, team fields); removed i18n; updated media/attachment URLs and dimensions; reaction timelines synced; durations changed.
HTTP Events
.../http_events.json
typing.start payload updated with new cid/channel_id, timestamps; user fields expanded (avg_response_time, capabilities); duration adjusted.
WebSocket Events
.../ws_events.json, .../ws_events_channel.json, .../ws_events_member.json, .../ws_health_check.json, .../ws_message.json, .../ws_reaction.json
New channel/message IDs; timestamps advanced; devices/push token IDs refreshed; user fields expanded (avg_response_time, capabilities, team); member_count reduced; message_count added; unread counts updated; i18n removed; reaction/group timelines updated; structural reordering.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • testableapple

Poem

A rabbit taps keys in the fixture glade,
New IDs hop in, old timestamps fade.
Capabilities bloom, reminders chime,
Members re-counted in perfect time.
i18n burrows, message_count springs—
Mock burrows tidy for all test things. 🐇✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title “[CI] Sync Mock Server” succinctly conveys that this automated pull request is focused on synchronizing the mock server fixtures via CI, and it directly reflects the core change without unnecessary detail.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ci/sync-mock-server-1759277930

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

github-actions bot commented Oct 1, 2025

1 Warning
⚠️ Big PR

Generated by 🚫 Danger

Copy link

@coderabbitai coderabbitai bot left a 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 the members 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.

📥 Commits

Reviewing files that changed from the base of the PR and between 7bba56b and 0e7168f.

📒 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 the members 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 to unreadCount, totalUnreadCount, or unreadChannels 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, and duration 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 new thumb_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
The avg_response_time key maps to avgResponseTime in UserPayloadsCodingKeys, and all other new keys (e.g. type, canReceiveMessages, canBeAddedToGroups, custom_extra_data_key, team) flow into extraData without breaking decoding.


30-32: Verify MemberRole enum and JSON decoding for new member field

Although MemberInfoPayload already maps "channel_role" to channelRole, please confirm that the MemberRole enum defines the expected case(s) and add a decoding test using the http_message_ephemeral.json fixture to cover the new member 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 in Sources/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 maps member.channel_rolechannelRole (init/CodingKeys) and that UI/permission logic reads channelRole where appropriate.

@testableapple testableapple marked this pull request as draft October 1, 2025 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant