Skip to content

Conversation

@HeyImChris
Copy link

@HeyImChris HeyImChris commented May 28, 2021

Please select one of the following

  • I am removing an existing difference between facebook/react-native and microsoft/react-native-macos 👍
  • I am cherry-picking a change from Facebook's react-native into microsoft/react-native-macos 👍
  • I am making a fix / change for the macOS implementation of react-native
  • I am making a change required for Microsoft usage of react-native

Summary

We're seeing crashes because a nil URL is passed in here. We're investigating the root cause of who is passing in nil, but we can also be better at graciously handling an invalid URL. Instead of crashing, let's assert and skip the websocket connection.

After this goes into master I can cherry-pick into our stable branches.

Changelog

[Apple] [Bug] - Nil check nil websocket URL

Test Plan

I can't repro this failure myself, but we've gotten reports of it. A simple nil check and assert should at least prevent crashes. I did the basic due diligence of verifying with the API that it requires a non-null parameter and will throw an exception if we pass in nil.

HeyImChris and others added 19 commits May 14, 2020 15:03
Merge upstream into fork
@HeyImChris HeyImChris requested a review from harrieshin May 28, 2021 17:56
@HeyImChris HeyImChris self-assigned this May 28, 2021
@HeyImChris HeyImChris requested a review from alloy as a code owner May 28, 2021 17:56
@pull-bot
Copy link

Messages
📖

📋 Verify Changelog Format - A changelog entry has the following format: [CATEGORY] [TYPE] - Message.

DetailsCATEGORY may be:
  • General
  • macOS
  • iOS
  • Android
  • JavaScript
  • Internal (for changes that do not need to be called out in the release notes)

TYPE may be:

  • Added, for new features.
  • Changed, for changes in existing functionality.
  • Deprecated, for soon-to-be removed features.
  • Removed, for now removed features.
  • Fixed, for any bug fixes.
  • Security, in case of vulnerabilities.

MESSAGE may answer "what and why" on a feature level. Use this to briefly tell React Native users about notable changes.

Generated by 🚫 dangerJS against cdbbccd

@HeyImChris HeyImChris merged commit 415abb5 into microsoft:master May 28, 2021
HeyImChris added a commit to HeyImChris/react-native-macos that referenced this pull request May 28, 2021
* Update RCTCxxBridge.mm

* Update RCTCxxBridge.mm

* nil check websocket URL

* use RCTAssertParam

Co-authored-by: Chris Hogan <chrishogan@Chriss-MacBook-Pro-2.local>
HeyImChris added a commit to HeyImChris/react-native-macos that referenced this pull request May 28, 2021
* Update RCTCxxBridge.mm

* Update RCTCxxBridge.mm

* nil check websocket URL

* use RCTAssertParam

Co-authored-by: Chris Hogan <chrishogan@Chriss-MacBook-Pro-2.local>
HeyImChris added a commit that referenced this pull request Jun 1, 2021
* Check a nil URL to fix crashes connecting to socket (#785)

* Update RCTCxxBridge.mm

* Update RCTCxxBridge.mm

* nil check websocket URL

* use RCTAssertParam

Co-authored-by: Chris Hogan <chrishogan@Chriss-MacBook-Pro-2.local>

* disable hermes

Co-authored-by: Chris Hogan <chrishogan@Chriss-MacBook-Pro-2.local>
HeyImChris added a commit that referenced this pull request Jun 1, 2021
* Add nullability checks (#704)

* Update RCTCxxBridge.mm

* add nullability checks

* Check a nil URL to fix crashes connecting to socket (#785)

* Update RCTCxxBridge.mm

* Update RCTCxxBridge.mm

* nil check websocket URL

* use RCTAssertParam

Co-authored-by: Chris Hogan <chrishogan@Chriss-MacBook-Pro-2.local>

* pod install

Co-authored-by: Chris Hogan <chrishogan@Chriss-MacBook-Pro-2.local>
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.

3 participants