Skip to content
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

fix: channel.state break on going to background #2807

Merged
merged 1 commit into from
Nov 22, 2024

Conversation

isekovanic
Copy link
Contributor

@isekovanic isekovanic commented Nov 22, 2024

🎯 Goal

Fixes a very old and prominent issue we've had in the SDK where sometimes upon a very specific queue of actions messages would stop updating in real time.

The issue is well documented in the following issues:

  • This GH issue
  • This Zendesk ticket
  • Many other scattered comments across other issues that I'm unable to find right now

Despite the oneliner fix, this issue was incredibly difficult to reproduce consistently - especially because typically it would manifest differently across different integrations.

The TL;DR version of it is:

  • Whenever we put the app using the SDK in background (either through going to background, locking the phone or whatever) we close the WS connection due to various reasons (the ability to receive push notifications, not wanting to endlessly keep the connection alive for long etc)
  • When this happens, we would preemptively mark all channels as "out of date" in the hope of them resyncing by default when we're back
  • However, whenever coming back from BG this state would never be cleared and properly set
  • Then, in various circumstances this particular check of the channel logic in our low level client would fail and so we'd never receive new messages, unable to recover unless we manually trigger loading to more recent messages or simply reload the app

Removing it is completely safe as we handle the resyncing of channels elsewhere.

🛠 Implementation details

🎨 UI Changes

iOS
Before After
Android
Before After

🧪 Testing

☑️ Checklist

  • I have signed the Stream CLA (required)
  • PR targets the develop branch
  • Documentation is updated
  • New code is tested in main example apps, including all possible scenarios
    • SampleApp iOS and Android
    • Expo iOS and Android

@Stream-SDK-Bot
Copy link
Contributor

SDK Size

title develop branch diff status
js_bundle_size 452 KB 455 KB +2624 B 🔴

@isekovanic isekovanic merged commit 6201f33 into v6.0.0 Nov 22, 2024
7 of 8 checks passed
@isekovanic isekovanic deleted the fix/channel-state-break-on-background branch November 22, 2024 11:56
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.

2 participants