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: make ws connection more robust when user is not set yet #2098

Merged
merged 4 commits into from
May 12, 2023

Conversation

vanGalilea
Copy link
Contributor

🎯 Goal

One of our customers experienced a crash on prod. due to a combination of:

  • network latency.
  • unknown user id when opening connection to WS
  • switching from background to foreground

🛠 Implementation details

🎨 UI Changes

N/A

🧪 Testing

  • Throttle internet connection to a slow one via an Android emulator
  • await client.connectUser(... with enabledOfflineSupport={true} option
  • go to background and come back to the app foreground.
  • No error should occur and console should be clean.

☑️ 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

…r-id' into hotfix/ws-connection-unknown-user-id

# Conflicts:
#	package/src/components/Chat/hooks/useIsOnline.ts
@sonarcloud
Copy link

sonarcloud bot commented May 12, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@santhoshvai santhoshvai merged commit 548e5ae into develop May 12, 2023
6 checks passed
@santhoshvai santhoshvai deleted the hotfix/ws-connection-unknown-user-id branch May 12, 2023 15:47
@github-actions github-actions bot mentioned this pull request May 12, 2023
vanGalilea added a commit that referenced this pull request May 12, 2023
* chore: adding needed info to bug report template (#2087)

* chore: adding needed info to bug report template

* chore: adding needed info to bug report template

* adding yarn.lock

* Delete Podfile.lock

* Chore: fixing broken android ci (#2089)

* chore: adding needed info to bug report template

* chore: adding needed info to bug report template

* adding yarn.lock

* Delete Podfile.lock

* fix: android build by adding missing ReactNativeFlipper.java for release

* Update bug_report.md (#2090)

* docs: dont install a sepc. react-native-quick-sqlite version and contemp. comp. version table (#2091)

* Delete shared

* docs: adding sonar badge (#2096)

* fix: AutoCompleteInput setInputBoxRef typing (#2095)

* fix: AutoCompleteInput setInputBoxRef typing

* fix: AutoCompleteInput setInputBoxRef typing

* fix: make ws connection more robust when user is not set yet (#2098)

* fix: check whether client.userID (connecting user started at least) exists before opening a connection

* fix: check whether client.userID (connecting user started at least) exists before opening a connection

* podfile + yarn.lock
@github-actions github-actions bot mentioned this pull request May 12, 2023
vanGalilea added a commit that referenced this pull request May 12, 2023
* chore: adding needed info to bug report template (#2087)

* chore: adding needed info to bug report template

* chore: adding needed info to bug report template

* adding yarn.lock

* Delete Podfile.lock

* Chore: fixing broken android ci (#2089)

* chore: adding needed info to bug report template

* chore: adding needed info to bug report template

* adding yarn.lock

* Delete Podfile.lock

* fix: android build by adding missing ReactNativeFlipper.java for release

* Update bug_report.md (#2090)

* docs: dont install a sepc. react-native-quick-sqlite version and contemp. comp. version table (#2091)

* Delete shared

* docs: adding sonar badge (#2096)

* fix: AutoCompleteInput setInputBoxRef typing (#2095)

* fix: AutoCompleteInput setInputBoxRef typing

* fix: AutoCompleteInput setInputBoxRef typing

* fix: make ws connection more robust when user is not set yet (#2098)

* fix: check whether client.userID (connecting user started at least) exists before opening a connection

* fix: check whether client.userID (connecting user started at least) exists before opening a connection

* podfile + yarn.lock

* fix: forcing release

---------

Co-authored-by: Steve Galili <steve.galili@getstream.io>
@github-actions github-actions bot mentioned this pull request May 15, 2023
@stream-ci-bot
Copy link
Contributor

🎉 This PR is included in version 5.14.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

None yet

3 participants