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

RCTLogBox window is orphaned, covering entire screen #32434

Closed
paddlefish opened this issue Oct 18, 2021 · 0 comments
Closed

RCTLogBox window is orphaned, covering entire screen #32434

paddlefish opened this issue Oct 18, 2021 · 0 comments
Labels
Needs: Triage 🔍 Resolution: Locked This issue was locked by the bot.

Comments

@paddlefish
Copy link
Contributor

Please provide all the information requested. Issues that do not follow this format are likely to stall.

Description

After dismissing a log box, instead of the window closing it stays up, covering the entire screen. All touch events are sent to this window, making your app appear unresponsive.

React Native version:

info Fetching system and libraries information...
System:
OS: macOS 11.6
CPU: (8) x64 Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz
Memory: 594.77 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 14.17.5 - /var/folders/0p/9rg5ktq9567gdp5_wxtry09c0000gn/T/yarn--1634585580336-0.73268870857558/node
Yarn: 1.22.11 - /var/folders/0p/9rg5ktq9567gdp5_wxtry09c0000gn/T/yarn--1634585580336-0.73268870857558/yarn
npm: 7.23.0 - ~/.nvm/versions/node/v14.17.5/bin/npm
Watchman: 2021.06.07.00 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.11.2 - /Users/arahn/.rvm/gems/ruby-2.6.3/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 15.0, DriverKit 20.4, macOS 11.3, tvOS 15.0, watchOS 8.0
Android SDK: Not Found
IDEs:
Android Studio: 4.2 AI-202.7660.26.42.7351085
Xcode: 13.0/13A233 - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_65 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.2 => 17.0.2
react-native: 0.66.1 => 0.66.1
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

Steps To Reproduce

Provide a detailed list of steps that reproduce the issue.

  1. Use console.warn to generate a yellow warning message in log box
  2. click the log
  3. tap "dismiss"
  4. try to tap anywhere

Expected Results

The tap is received by your app

Actual Results

The tap goes to a hidden window that is covering the entire screen

Snack, code example, screenshot, or link to a repository:

RCTLogBoxView

lunaleaps pushed a commit that referenced this issue Nov 4, 2021
#32435)

Summary:
Fixes  #32434: RCTLogBox window is orphaned, covering entire screen.

After this change, the logbox window once again is removed from the screen.

## Changelog

Some third-party SDKs may hold references to created UIWindow, UIViewController, or UIView objects. Doing so means that the current code's `hide` method that releases the reference to the UIWindow in LogBox will not cause the window to be dealloc'd, and thus instead it will remain on the screen. This change explicitly hides the LogBox window when the reference is released, so that even if some other SDK holds onto the window it will still be taken off the screen.

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[iOS] [Fixed] - 32434

Pull Request resolved: #32435

Test Plan:
1.     Use console.warn to generate a yellow warning message in log box.  Also install a third-party SDK that holds onto a reference to UIWindow -- for example the Facebook SDK, the Data Dog SDK, or any number of other SDKs that use `swizzling` to intercept calls like `viewDidAppear:`.
2.     click the log
3.     tap "dismiss"
4.     try to tap anywhere
5. Use Xcode view debugger to inspect the UI state

## Expected

The app still responds to the touch.
In Xcode, there is not an extra UIWindow covering the screen

Reviewed By: philIip

Differential Revision: D31794242

Pulled By: sshic

fbshipit-source-id: 28aa247b3ed3fd60b8e7c2ed7d0606cbf5c42408
@facebook facebook locked as resolved and limited conversation to collaborators Oct 24, 2022
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Oct 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Needs: Triage 🔍 Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants