Skip to content

fix(llc): drop unhandled coordinator events without a warning per event - #1476

Closed
renefloor wants to merge 2 commits into
mainfrom
fix/coordinator-unhandled-events
Closed

renefloor wants to merge 2 commits into
mainfrom
fix/coordinator-unhandled-events

Conversation

@renefloor

@renefloor renefloor commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

🎯 Goal

Apps using Stream Chat and Stream Video with the same API key receive chat events (message.new, reaction.new, typing.start, …) on the video coordinator socket. Each one logged a warning, SV:EventType [fromAlias] unexpected alias: message.new, plus an info line.

In the LyveChat 20k livestream load test (2026-10-16, Pixel 8 viewer, ~15 chat messages/s), 510 of 513 recorded SDK log lines in one run were that warning. The test app registers an external logger, so each one also cost a log write.

🛠 Implementation details

  • EventType.fromAlias uses a static alias map instead of a linear firstWhere, and logs unhandled types at verbose instead of warning.
  • OpenApiEvent.fromJson returns early for unknown types: no per-event info log, and no debug log of the whole payload.
  • CoordinatorUnknownEvent is still emitted, so there is no public API or behaviour change.
  • The JSON decode is kept. Skipping it would need a substring match on the raw message, and it is a small cost (~3µs per 1KB payload on desktop).

🎨 UI Changes

None.

🧪 Testing

  • New test/src/coordinator/open_api/open_api_event_test.dart: every known type still maps, chat types and an unknown call.* type only log at verbose, and a message.new payload parses without throwing.
  • Throwaway benchmark (not committed), 1000 chat message.new payloads with logging at info: 2 log lines per message before, 0 after. Parse time was ~4µs per message either way on desktop JIT, within noise.
  • Full stream_video suite passes.

☑️Contributor Checklist

General

  • Assigned a person / code owner group (required)
  • Thread with the PR link started in a respective Slack channel (#flutter-team) (required)
  • PR is linked to the GitHub issue it resolves

☑️Reviewer Checklist

  • Sample runs & works
  • UI Changes correct (before & after images)
  • Bugs validated (bugfixes)
  • New feature tested and works
  • All code we touched has new or updated Documentation

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Unsupported events received on shared connections, including chat events, are now logged at a lower verbosity instead of generating warnings.
    • Unrecognized events are handled consistently as unknown events, with their original data preserved. This reduces unnecessary warning logs while retaining event information for cases the video SDK does not support.

Chat events arriving on a coordinator socket shared with Stream Chat now
log at verbose instead of warning, the alias lookup is a map, and unknown
events skip the per-event info log.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6bc7694b-526b-4bb9-8b49-2bdf5761715d
📥 Commits

Reviewing files that changed from the base of the PR and between 5805066 and 50c463b.

📒 Files selected for processing: 4
  • packages/stream_video/CHANGELOG.md
  • packages/stream_video/lib/src/coordinator/open_api/event/event_type.dart
  • packages/stream_video/lib/src/coordinator/open_api/event/open_api_event.dart
  • packages/stream_video/test/src/coordinator/open_api/open_api_event_test.dart

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Walkthrough

Unknown event aliases now use a static lookup map and are logged at verbose level. JSON parsing retains the original payload for unknown event types without logging them from the event switch.

Changes: Event Handling

Layer / File(s) Summary
Alias lookup and logging
packages/stream_video/lib/src/coordinator/open_api/event/event_type.dart, packages/stream_video/test/src/coordinator/open_api/open_api_event_test.dart, packages/stream_video/CHANGELOG.md
EventType.fromAlias uses a static map and logs unrecognized aliases at verbose level. Tests check alias results and log priorities. The changelog records the logging change.
Unknown event parsing
packages/stream_video/lib/src/coordinator/open_api/event/open_api_event.dart, packages/stream_video/test/src/coordinator/open_api/open_api_event_test.dart
OpenApiEvent.fromJson returns unknown event types with the original JSON and no unexpected-event log. Tests cover an unknown chat event and a known health.check event.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: xsahil03x, brazol

Merge Risk: ⚪ Minimal · up to 50c46

The change appears ready to merge after normal checks.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly identifies the main change: preventing warnings for unhandled coordinator events. It is concise and specific.
Description check Passed The description includes the goal, implementation details, UI status, testing details, and benchmark results. The contributor and reviewer checklist items remain unchecked, but the main required chang…
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description includes the goal, implementation details, UI status, testing details, and benchmark results. The contributor and reviewer checklist items remain unchecked, but the main required change information is complete.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (4 skipped: 4 unsupported.)

✨ Finishing Touches: 💡 1
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks: 💡
  • 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.

❤️ Share

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

@github-actions github-actions Bot added the v1 label Oct 16, 2026
@codecov

codecov Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 16.40%. Comparing base (5805066) to head (50c463b).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1476      +/-   ##
==========================================
+ Coverage   16.10%   16.40%   +0.30%     
==========================================
  Files         690      690              
  Lines       51391    51392       +1     
==========================================
+ Hits         8274     8432     +158     
+ Misses      43117    42960     -157     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@renefloor
renefloor marked this pull request as ready for review October 16, 2026 14:23
@renefloor
renefloor requested a review from a team as a code owner October 16, 2026 14:23
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

SDK Size

title main branch diff status
android_stream_video 15.66 MB 15.66 MB 0 KB 🟢
android_stream_video_flutter 17.51 MB 17.51 MB 0 KB 🟢
ios_stream_video 16.08 MB 16.08 MB 0 KB 🟢
ios_stream_video_flutter 18.39 MB 18.39 MB 0 KB 🟢
pub_stream_video 0.69 MB 0.7 MB +1 KB 🟢
pub_stream_video_filters 0.02 MB 0.02 MB 0 KB 🟢
pub_stream_video_flutter 0.54 MB 0.54 MB 0 KB 🟢
pub_stream_video_noise_cancellation 0.05 MB 0.05 MB 0 KB 🟢
pub_stream_video_push_notification 0.35 MB 0.35 MB 0 KB 🟢
pub_stream_video_screen_sharing 0.01 MB 0.01 MB 0 KB 🟢

Measured on 50c463b.

@github-actions

Copy link
Copy Markdown

Size Breakdown

What each SDK adds to an empty release app, per Dart package and native library. Dart sizes are uncompressed symbol sizes. Open the sdk-size-analysis artifacts of this run in the DevTools App Size tool to drill down further.

Measured on 50c463b.

android · stream_video: 15.56 MB (-0.2 KB)
Component Size Δ vs main
native:libjingle_peerconnection_so.so 11.96 MB 0
package:stream_video 1.8 MB -0.3 KB
dart:@unknown 282.2 KB +0.0 KB
classes.dex 261.9 KB 0
dart:_http 152.7 KB 0
package:protobuf 145.6 KB 0
native:libdartjni.so 121.7 KB 0
dart:io 99.4 KB 0
dart:async 71.8 KB 0
package:stream_webrtc_flutter 56.2 KB +0.0 KB
dart:core 50.8 KB 0
dart:mixin_deduplication 49.7 KB 0
package:rxdart 48.2 KB 0
package:source_span 44.1 KB 0
dart:typed_data 31.3 KB 0
other (66) 423.7 KB +0.1 KB
android · stream_video_flutter: 17.38 MB (-0.5 KB)
Component Size Δ vs main
native:libjingle_peerconnection_so.so 11.96 MB 0
package:stream_video 1.84 MB -0.3 KB
package:flutter 774.4 KB +0.0 KB
classes.dex 454.8 KB 0
dart:@unknown 418.5 KB -0.3 KB
dart:_http 155.6 KB 0
dart:mixin_deduplication 152.0 KB 0
package:protobuf 146.7 KB +0.0 KB
package:stream_video_flutter 132.9 KB 0
native:libdartjni.so 121.7 KB 0
dart:io 119.3 KB 0
assets 81.5 KB 0
dart:async 75.4 KB 0
dart:collection 63.1 KB 0
dart:ui 61.9 KB 0
other (88) 913.5 KB +0.1 KB
ios · stream_video: 16.06 MB (-0.0 KB)
Component Size Δ vs main
native:StreamWebRTC.framework 11.82 MB 0
package:stream_video 1.95 MB -0.0 KB
Runner 630.4 KB 0
dart:@unknown 279.5 KB -0.1 KB
dart:_http 164.9 KB 0
native:objective_c.framework 164.2 KB 0
package:protobuf 155.8 KB 0
dart:io 95.7 KB 0
dart:async 78.7 KB 0
package:stream_webrtc_flutter 63.6 KB 0
package:rxdart 54.6 KB 0
dart:mixin_deduplication 54.3 KB 0
dart:core 52.2 KB 0
package:source_span 46.9 KB 0
dart:@shared 44.3 KB +0.0 KB
other (66) 462.4 KB +0.0 KB
ios · stream_video_flutter: 18.34 MB (+0.1 KB)
Component Size Δ vs main
native:StreamWebRTC.framework 11.82 MB 0
package:stream_video 1.99 MB -0.0 KB
Runner 1.17 MB 0
package:flutter 886.1 KB 0
dart:@unknown 420.6 KB +0.0 KB
dart:_http 167.8 KB 0
native:objective_c.framework 164.2 KB 0
dart:mixin_deduplication 160.7 KB +0.0 KB
package:protobuf 157.0 KB 0
package:stream_video_flutter 139.5 KB 0
dart:io 117.1 KB 0
Frameworks 84.2 KB 0
dart:async 83.0 KB 0
dart:@shared 76.2 KB -0.0 KB
dart:ui 71.2 KB +0.0 KB
other (89) 914.9 KB +0.0 KB

@renefloor renefloor closed this Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant