X Tutup
The Wayback Machine - https://web.archive.org/web/20250430172135/https://github.com/NativeScript/NativeScript/pull/9671
Skip to content

fix: ensure we clear ios view. #9671

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

Merged
merged 2 commits into from
Mar 5, 2022
Merged

Conversation

farfromrefug
Copy link
Collaborator

This has been like this for a long time without explanation. And it has side effects like here #7469.
It does not seem to have any side effects from my tests.

I open this as draft right now but we should be able to release this

farfromrefug and others added 2 commits November 17, 2021 16:07
This has been like this for a long time without explanation. And it has side effects like here #7469.
It does not seem to have any side effects from my tests.
@cla-bot cla-bot bot added the cla: yes label Mar 5, 2022
@NathanWalker NathanWalker changed the base branch from master to release/8.2.0 March 5, 2022 03:43
@NathanWalker NathanWalker marked this pull request as ready for review March 5, 2022 03:43
@NathanWalker NathanWalker merged commit 6a60b83 into release/8.2.0 Mar 5, 2022
@NathanWalker NathanWalker deleted the farfromrefug-patch-5 branch March 5, 2022 03:49
rigor789 added a commit that referenced this pull request Mar 6, 2022
This reverts commit 6a60b83.

We identified issues with this change that cause errors in `onUnloaded()` callbacks.
@rigor789 rigor789 restored the farfromrefug-patch-5 branch March 6, 2022 18:40
@rigor789 rigor789 deleted the farfromrefug-patch-5 branch March 6, 2022 18:40
@rigor789
Copy link
Member

rigor789 commented Mar 6, 2022

Reverted this change as it was causing errors when showing/hiding views in the hierarchy. We've seen different instances of similar errors caused by this change. We should definitely re-visit this and figure out why these errors happen.

A few errors caused by this change
***** Fatal JavaScript exception - application has been terminated. *****
NativeScript encountered a fatal error: Uncaught TypeError: Cannot set property 'delegate' of null
at
onUnloaded(file: src/webpack:/node_modules/@nativescript/core/ui/text-field/index.ios.js:114:0)
at (file: src/webpack:/node_modules/@nativescript/core/ui/core/view-base/index.js:321:0)
at callFunctionWithSuper(file: src/webpack:/node_modules/@nativescript/core/ui/core/view-base/index.js:312:0)
at callUnloaded(file: src/webpack:/node_modules/@nativescript/core/ui/core/view-base/index.js:321:0)
at unloadView(file: src/webpack:/node_modules/@nativescript/core/ui/core/view-base/index.js:466:0)
at (file: src/webpack:/node_modules/@nativescript/core/ui/core/view-base/index.js:249:0)
at eachChildView(file: src/webpack:/node_modules/@nativescript/core/ui/layouts/layout-base-common.js:101:0)
at eachChild(file: src/webpack:/node_modules/@nativescript/core/ui/core/view/view-common.js:772:0)
at onUnloaded(file: src/webpack:/node_modules/@nativescript/core/ui/core/view-base/index.js:248:0)
at (file: src/webpack:/node_modules/@nativescript/core/ui/core/view-base/index.js:321:0)
at callFunctionWithSuper(file: src/webpack:/node_modules/@nativescript/core/ui/core/view-base/index.js:312:0)
at callUnloaded(file: src/webpack:/node_modules/@nativescript/core/ui/core/view-base/index.js:321:0)
at unloadView(file: src/webpack:/node_modules/@nativescript/core/ui/core/view-base/index.js:466:0)
at (file: src/webpack:/node_modules/@nativescript/core/ui/core/view-base/index.js:249:0)
at eachChildView(file: src/webpack:/node_modules/@nativescript/core/ui/layouts/layout-base-common.js:101:0)
at eachChild(file: src/webpack:/node_modules/@nativescript/core/ui/core/view/view-common.js:772:0)
at onUnloaded(file: src/webpack:/node_modules/@nativescript/core/ui/core/view-base/index.js:248:0)
at (file: src/webpack:/node_modules/@nativescript/core/ui/core/view-base/index.js:321:0)
at callFunctionWithSuper(file: src/webpack:/node_modules/@nativescript/core/ui/core/view-base/index.js:312:0)
at callUnloaded(file:///app/vend<…>
TypeError: Cannot set property 'delegate' of null
at RadListView.onUnloaded (file: src/webpack:/node_modules/nativescript-ui-listview/index.ios.js:1342:0)
at file: src/webpack:/node_modules/@nativescript/core/ui/core/view-base/index.js:321:0
at RadListView.callFunctionWithSuper (file: src/webpack:/node_modules/@nativescript/core/ui/core/view-base/index.js:312:0)
at RadListView.callUnloaded (file: src/webpack:/node_modules/@nativescript/core/ui/core/view-base/index.js:321:0)
at ProxyViewContainer.unloadView (file: src/webpack:/node_modules/@nativescript/core/ui/core/view-base/index.js:466:0)
at file: src/webpack:/node_modules/@nativescript/core/ui/core/view-base/index.js:249:0
at ProxyViewContainer.eachChildView (file: src/webpack:/node_modules/@nativescript/core/ui/layouts/layout-base-common.js:101:0)
at ProxyViewContainer.eachChild (file: src/webpack:/node_modules/@nativescript/core/ui/core/view/view-common.js:772:0)
at ProxyViewContainer.onUnloaded (file: src/webpack:/node_modules/@nativescript/core/ui/core/view-base/index.js:248:0)
at file: src/webpack:/node_modules/@nativescript/core/ui/core/view-base/index.js:321:0
TypeError: Cannot set property 'delegate' of null
at Label.onUnloaded (file: src/webpack:/node_modules/@nativescript-community/ui-label/label.ios.js:160:8)
at file: src/webpack:/node_modules/@nativescript/core/ui/core/view-base/index.js:321:0
at Label.callFunctionWithSuper (file: src/webpack:/node_modules/@nativescript/core/ui/core/view-base/index.js:312:0)
at Label.callUnloaded (file: src/webpack:/node_modules/@nativescript/core/ui/core/view-base/index.js:321:0)
at GridLayout.unloadView (file: src/webpack:/node_modules/@nativescript/core/ui/core/view-base/index.js:466:0)
at GridLayout._removeViewCore (file: src/webpack:/node_modules/@nativescript/core/ui/core/view-base/index.js:490:0)
at GridLayout._removeView (file: src/webpack:/node_modules/@nativescript/core/ui/core/view-base/index.js:482:0)
at GridLayout.removeChild (file: src/webpack:/node_modules/@nativescript/core/ui/layouts/layout-base-common.js:48:0)
at GridLayout.removeChild (file: src/webpack:/node_modules/@nativescript/core/ui/layouts/layout-base.ios.js:13:0)
at ViewUtil.removeLayoutChild (file: src/webpack:/node_modules/@nativescript/angular/fesm2015/nativescript-angular.mjs:1499:19)

@edusperoni
Copy link
Contributor

I believe the cause of these errors might be something deeper, like unloaded being called multiple times. The view is already deleted, there's no reason to why unloaded was called. Also, the delegates are always deleted on unloaded which I don't think is the correct approach

@farfromrefug
Copy link
Collaborator Author

@rigor789 we might need to revisit this. would you by any chance have a reproducible example of the errors which made you revert this ?

CatchABus added a commit to CatchABus/NativeScript that referenced this pull request Apr 22, 2022
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.

4 participants
X Tutup