-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Hide the logbox window explicitly. New behavior in iOS SDK appears to… #32435
Conversation
… retain UIWindow while visible.
PR build artifact for 1d47f16 is ready. |
Base commit: 0c07500 |
Base commit: 63f66fc |
I'm having difficulty reproducing this issue, can you provide a snack or an example project please? |
@charlesbdudley I created a new project with the same iOS SDK and was also unable to reproduce this. I spent a while in my real app using Instruments to see if I could figure out where the retain cycle is coming from. I have several third party SDKs installed. As is typical with "no code" marketing SDKs, these SDKs use However, even if that's true, I don't see why the proposed fix for this is a bad thing. Right now the logbox window only closes because it gets dealloc'd. The intention of the |
@paddlefish That makes sense to me! Thanks for digging deeper on this. To avoid confusion for the changelog, do you mind updating the title and description (more of an enhancement now than a bug fix)? Then I'll import it for internal review. |
@charlesbdudley I updated the title and description. |
@sshic has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i feel we should think of some way to remove the view from the actual hierarchy, though that is probably the responsibility of whomever decided to retain this window.
i think this is the safest and least invasive way to resolve this edge case, so accepting!
@sshic merged this pull request in 72ea0e1. |
#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
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.[iOS] [Fixed] - 32434
Test Plan
Expected
The app still responds to the touch.
In Xcode, there is not an extra UIWindow covering the screen