Skip to content

Stop logging core connection events at error level on every connect - #220

Merged
aleksandar-apostolov merged 1 commit into
developfrom
gianmarcodavid/and-1517-feeds-normal-core-connection-event-logged-at-error-level-on
Oct 7, 2026
Merged

aleksandar-apostolov merged 1 commit into
developfrom
gianmarcodavid/and-1517-feeds-normal-core-connection-event-logged-at-error-level-on

Conversation

@gpunto

@gpunto gpunto commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

Goal

Every successful connect logged E FeedsClient: [onEvent] Received non-WSEvent: StreamClientConnectedEvent(...). Core forwards its own lifecycle events to client listeners by design, so this was a spurious error on a healthy path.

Closes AND-1517

Implementation

  • Core events (StreamClientWsEvent) are now ignored and logged at verbose. Today these are connection.ok and connection.error; core already reports the latter through the Disconnected connection state.
  • Payloads that are neither feeds nor core events still log at error.

Testing

  • Unit tests for both branches.
  • Sample app on an emulator: connect now logs V ... Ignoring core event: StreamClientConnectedEvent(...) and no error.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Core WebSocket lifecycle events are now handled without being reported as errors. Unknown events continue to be ignored and logged.

Core forwards its own events (e.g. connection.ok) to client listeners, so
FeedsClient logged a spurious error on every connect. Log them at verbose
and keep error level for genuinely unexpected payloads.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gpunto gpunto added the pr:bug Bug fix label Oct 5, 2026
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

PR checklist ✅

All required conditions are satisfied:

  • Title length is OK (or ignored by label).
  • At least one pr: label exists.
  • Sections ### Goal, ### Implementation, and ### Testing are filled, or the PR is bot-authored.
  • An issue is linked (Linear ticket or GitHub issue), or the PR is bot-authored.

🎉 Great job! This PR is ready for review.

@sonarqubecloud

sonarqubecloud Bot commented Oct 5, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

SDK Size Comparison 📏

SDK Before After Difference Status
stream-feeds-android-client 2.55 MB 2.55 MB 0.00 MB 🟢

@gpunto
gpunto marked this pull request as ready for review October 5, 2026 13:50
@coderabbitai

coderabbitai Bot commented Oct 5, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

🧰 Additional context used
📚 Code guidelines (1)
AGENTS.md — auto-discovered

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e32c2f1a-def8-42a8-816e-ff5035bc835b
📥 Commits

Reviewing files that changed from the base of the PR and between 2819014 and ed1dc17.

📒 Files selected for processing (2)
  • stream-feeds-android-client/src/main/kotlin/io/getstream/feeds/android/client/internal/client/FeedsClientImpl.kt
  • stream-feeds-android-client/src/test/kotlin/io/getstream/feeds/android/client/internal/client/FeedsClientImplTest.kt

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

The WebSocket listener now logs and ignores core lifecycle events instead of treating them as errors. Tests cover core lifecycle events and unknown event payloads.

Changes

WebSocket event handling

Layer / File(s) Summary
Listener event handling and tests
stream-feeds-android-client/src/main/kotlin/io/getstream/feeds/android/client/internal/client/FeedsClientImpl.kt, stream-feeds-android-client/src/test/kotlin/io/getstream/feeds/android/client/internal/client/FeedsClientImplTest.kt
The listener logs and ignores StreamClientWsEvent instances. Tests verify these events are not dispatched or error-logged, and that unknown payloads are not dispatched and produce one error log.

Priority: ⬇️ Low

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

Change: Bug fix

Suggested reviewers: aleksandar-apostolov

Merge Risk: ⚪ Minimal · up to ed1dc

Core lifecycle events are no longer treated as error-level unknown payloads, while unknown payloads retain error logging. The supplied summaries indicate coverage for both behaviors, with no actionable merge-blocking risk identified.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: stop logging expected core connection events at error level.
Description check ✅ Passed The description covers the goal, implementation, and testing, and links the related issue. It omits the template’s Checklist section, but the main required information is present.
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.
  • 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
  • Autopilot · 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

A rabbit watched the socket glow
Core events passed without a fuss
Unknown events were logged once
Tests checked each path with care
Then hopped away through clover-green

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

@gpunto
gpunto enabled auto-merge (squash) October 6, 2026 07:34
@aleksandar-apostolov
aleksandar-apostolov merged commit 2459702 into develop Oct 7, 2026
13 of 14 checks passed
@aleksandar-apostolov
aleksandar-apostolov deleted the gianmarcodavid/and-1517-feeds-normal-core-connection-event-logged-at-error-level-on branch October 7, 2026 09:47
@stream-public-bot stream-public-bot added the released Included in a release label Oct 7, 2026
@stream-public-bot

Copy link
Copy Markdown
Collaborator

🚀 Available in v0.11.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:bug Bug fix released Included in a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants