René's URL Explorer Experiment


Title: fix(ios): Do not call setNeedsLayout() when another layout update request is in process by CatchABus · Pull Request #9875 · NativeScript/NativeScript · GitHub

Open Graph Title: fix(ios): Do not call setNeedsLayout() when another layout update request is in process by CatchABus · Pull Request #9875 · NativeScript/NativeScript

X Title: fix(ios): Do not call setNeedsLayout() when another layout update request is in process by CatchABus · Pull Request #9875 · NativeScript/NativeScript

Description: PR Checklist The PR title follows our guidelines: https://github.com/NativeScript/NativeScript/blob/master/tools/notes/CONTRIBUTING.md#commit-messages. There is an issue for the bug/feature this PR is for. To avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it. You have signed the CLA. All existing tests are passing: https://github.com/NativeScript/NativeScript/blob/master/tools/notes/DevelopmentWorkflow.md#running-unit-tests-application. Tests for the changes are included - https://github.com/NativeScript/NativeScript/blob/master/tools/notes/WritingUnitTests.md. What is the current behavior? There are cases that a layout contains children that often get updated because of bindings. In my case, it was a list of GridLayouts with nested images, the visibility of which was changing through user interactivity. Upon 2-3 uses, my app was crashing with an assertion failed message: ====== Assertion failed ====== Native stack trace: 1 0x103a1e7d8 tns::Assert(bool, v8::Isolate*) + 128 2 0x1039a6848 tns::ArgConverter::Invoke(v8::Local, objc_class*, v8::Local, tns::V8Args&, tns::MethodMeta const*, bool) + 100 3 0x1039f9658 tns::MetadataBuilder::InvokeMethod(v8::Local, tns::MethodMeta const*, v8::Local, tns::V8Args&, std::__1::basic_string, std::__1::allocator >, bool) + 88 4 0x1039f8ec0 tns::MetadataBuilder::MethodCallback(v8::FunctionCallbackInfo const&) + 220 5 0x103b300e4 v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) + 544 6 0x103b2f5e4 v8::internal::MaybeHandle v8::internal::(anonymous namespace)::HandleApiCallHelper(v8::internal::Isolate*, v8::internal::Handle, v8::internal::Handle, v8::internal::Handle, v8::internal::Handle, v8::internal::BuiltinArguments) + 524 7 0x103b2ed7c v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate*) + 228 8 0x10420a64c Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit + 108 9 0x1041a3818 Builtins_InterpreterEntryTrampoline + 248 10 0x1041a3818 Builtins_InterpreterEntryTrampoline + 248 11 0x1041a3818 Builtins_InterpreterEntryTrampoline + 248 12 0x1041a3818 Builtins_InterpreterEntryTrampoline + 248 13 0x1041a3818 Builtins_InterpreterEntryTrampoline + 248 14 0x1041a3818 Builtins_InterpreterEntryTrampoline + 248 15 0x1041a3818 Builtins_InterpreterEntryTrampoline + 248 16 0x1041a3818 Builtins_InterpreterEntryTrampoline + 248 17 0x1041a3818 Builtins_InterpreterEntryTrampoline + 248 18 0x1041a3818 Builtins_InterpreterEntryTrampoline + 248 19 0x1041a3818 Builtins_InterpreterEntryTrampoline + 248 20 0x1041a3818 Builtins_InterpreterEntryTrampoline + 248 21 0x1041a3818 Builtins_InterpreterEntryTrampoline + 248 22 0x1041a3818 Builtins_InterpreterEntryTrampoline + 248 23 0x1041a3818 Builtins_InterpreterEntryTrampoline + 248 24 0x1041a3818 Builtins_InterpreterEntryTrampoline + 248 25 0x1041a3818 Builtins_InterpreterEntryTrampoline + 248 26 0x1041a3818 Builtins_InterpreterEntryTrampoline + 248 27 0x1041a3818 Builtins_InterpreterEntryTrampoline + 248 28 0x1041a3818 Builtins_InterpreterEntryTrampoline + 248 29 0x1041a3818 Builtins_InterpreterEntryTrampoline + 248 30 0x1041a3818 Builtins_InterpreterEntryTrampoline + 248 31 0x1041dd220 Builtins_StoreIC + 832 32 0x10428ab74 Builtins_StaNamedPropertyHandler + 148 33 0x1041a3818 Builtins_InterpreterEntryTrampoline + 248 34 0x1041a15ec Builtins_JSEntryTrampoline + 172 35 0x1041a1284 Builtins_JSEntry + 164 36 0x103c7bcf4 v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) + 2532 37 0x103c7b2dc v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::Handle, v8::internal::Handle, int, v8::internal::Handle*) + 216 38 0x103e06f98 v8::internal::Object::SetPropertyWithAccessor(v8::internal::LookupIterator*, v8::internal::Handle, v8::Maybe) + 864 39 0x103e0aa88 v8::internal::Object::SetPropertyInternal(v8::internal::LookupIterator*, v8::internal::Handle, v8::Maybe, v8::internal::StoreOrigin, bool*) + 420 40 0x103e0a808 v8::internal::Object::SetProperty(v8::internal::LookupIterator*, v8::internal::Handle, v8::internal::StoreOrigin, v8::Maybe) + 80 41 0x103ed8774 v8::internal::Runtime::SetObjectProperty(v8::internal::Isolate*, v8::internal::Handle, v8::internal::Handle, v8::internal::Handle, v8::internal::StoreOrigin, v8::Maybe) + 272 42 0x103edbe58 v8::internal::Runtime_SetKeyedProperty(int, unsigned long*, v8::internal::Isolate*) + 88 43 0x10420a50c Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit + 108 44 0x10428adec Builtins_StaKeyedPropertyHandler + 140 45 0x1041a3818 Builtins_InterpreterEntryTrampoline + 248 46 0x1041a3818 Builtins_InterpreterEntryTrampoline + 248 47 0x1041a3818 Builtins_InterpreterEntryTrampoline + 248 48 0x1041a3818 Builtins_InterpreterEntryTrampoline + 248 49 0x1041a3818 Builtins_InterpreterEntryTrampoline + 248 50 0x1041a3818 Builtins_InterpreterEntryTrampoline + 248 51 0x1041a3818 Builtins_InterpreterEntryTrampoline + 248 52 0x1041a3818 Builtins_InterpreterEntryTrampoline + 248 53 0x1041a3818 Builtins_InterpreterEntryTrampoline + 248 54 0x1041a3818 Builtins_InterpreterEntryTrampoline + 248 55 0x1041ada24 Builtins_StoreIC_NoFeedback + 4132 56 0x10428ab74 Builtins_StaNamedPropertyHandler + 148 57 0x1041a3818 Builtins_InterpreterEntryTrampoline + 248 58 0x1041a3818 Builtins_InterpreterEntryTrampoline + 248 59 0x1041a3818 Builtins_InterpreterEntryTrampoline + 248 60 0x1041a3818 Builtins_InterpreterEntryTrampoline + 248 61 0x1041a3818 Builtins_InterpreterEntryTrampoline + 248 62 0x1041a15ec Builtins_JSEntryTrampoline + 172 63 0x1041a1284 Builtins_JSEntry + 164 64 0x103c7bcf4 v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) + 2532 65 0x103c7b2dc v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::Handle, v8::internal::Handle, int, v8::internal::Handle*) + 216 66 0x103ace780 v8::Function::Call(v8::Local, v8::Local, int, v8::Local*) + 448 67 0x1039a7f90 tns::ArgConverter::MethodCallback(ffi_cif*, void*, void**, void*) + 1156 68 0x103a99264 ffi_closure_SYSV_inner + 800 69 0x103a9c1b4 .Ldo_closure + 20 70 0x18624f42c + 56 71 0x186218560 + 116 72 0x1861e1260 + 284 73 0x18621a910 + 636 74 0x1861d2ad0 + 1988 75 0x1862068c8 + 784 76 0x186213a68 + 4428 77 0x1863c3318 + 828 78 0x1861e6c30 + 7904 79 0x1861dba1c + 6760 80 0x18701d7dc + 176 81 0x18684c7d8 + 84 82 0x186ec6008 + 144 83 0x186ec55f8 + 60 84 0x183c84020 + 28 85 0x183c94ce0 + 208 86 0x183bcefe8 + 268 87 0x183bd47f4 + 820 88 0x183be83b8 CFRunLoopRunSpecific + 600 89 0x19f57838c GSEventRunModal + 164 90 0x1865886a8 + 1100 91 0x1863077f4 UIApplicationMain + 2092 92 0x103a9c044 ffi_call_SYSV + 68 93 0x103a98ac8 ffi_call_int + 968 94 0x103a3b9dc tns::Interop::CallFunctionInternal(tns::MethodCall&) + 428 95 0x1039fe65c std::__1::__function::__func const&)::$_2, std::__1::allocator const&)::$_2>, void ()>::operator()() + 560 96 0x103a5ec04 tns::Tasks::Drain() + 100 97 0x103a58fd0 -[NativeScript initWithConfig:] + 600 98 0x102dff430 98 mobile 0x0000000102dff430 mobile + 29744 99 0x103901a24 99 dyld 0x0000000103901a24 start + 520 JavaScript stack trace: at requestLayout (file: node_modules/@nativescript/core/ui/core/view/index.ios.js:42:0) at performLayout (file: node_modules/@nativescript/core/ui/core/view-base/index.js:412:0) at requestLayout (file: node_modules/@nativescript/core/ui/core/view-base/index.js:419:0) at requestLayout (file: node_modules/@nativescript/core/ui/core/view/view-common.js:735:0) at requestLayout (file: node_modules/@nativescript/core/ui/core/view/index.ios.js:38:0) at performLayout (file: node_modules/@nativescript/core/ui/core/view-base/index.js:412:0) at requestLayout (file: node_modules/@nativescript/core/ui/core/view-base/index.js:419:0) at requestLayout (file: node_modules/@nativescript/core/ui/core/view/view-common.js:735:0) at requestLayout (file: node_modules/@nativescript/core/ui/core/view/index.ios.js:38:0) at performLayout (file: node_modules/@nativescript/core/ui/core/view-base/index.js:412:0) What is the new behavior? I concluded that an additional setNeedsLayout call was causing this crash in my app. My patch checks if a layout update has already been requested, and prevents pointless setNeedsLayout calls. Runtime version: 8.2 Core version: 8.2

Open Graph Description: PR Checklist The PR title follows our guidelines: https://github.com/NativeScript/NativeScript/blob/master/tools/notes/CONTRIBUTING.md#commit-messages. There is an issue for the bug/feature this...

X Description: PR Checklist The PR title follows our guidelines: https://github.com/NativeScript/NativeScript/blob/master/tools/notes/CONTRIBUTING.md#commit-messages. There is an issue for the bug/feature this...

Opengraph URL: https://github.com/NativeScript/NativeScript/pull/9875

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:aeef0f6b-8799-ecc8-7967-41b78c3dcc62
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id81E6:2BEA3E:1F0F6E6:2B5FF10:6A5F462C
html-safe-nonce7f43e516d67381a2104dadfab5faf75cc369041da6fde7229167f2a3cb2f0d00
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MUU2OjJCRUEzRToxRjBGNkU2OjJCNUZGMTA6NkE1RjQ2MkMiLCJ2aXNpdG9yX2lkIjoiMjczMDQzMzEyNzAwOTY5OTM3MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac787501f8f5de517658201e461e61cca260c44a00154abc46c55e24dc952786c9
hovercard-subject-tagpull_request:910874976
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/NativeScript/NativeScript/pull/9875/files
twitter:imagehttps://avatars.githubusercontent.com/u/55595100?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/55595100?s=400&v=4
og:image:altPR Checklist The PR title follows our guidelines: https://github.com/NativeScript/NativeScript/blob/master/tools/notes/CONTRIBUTING.md#commit-messages. There is an issue for the bug/feature this...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noneab2497d9345a59709926b385d88458fa5932c82ec066288448eb68b34cbcbbda
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/NativeScript/NativeScript git https://github.com/NativeScript/NativeScript.git
octolytics-dimension-user_id7392261
octolytics-dimension-user_loginNativeScript
octolytics-dimension-repository_id31492490
octolytics-dimension-repository_nwoNativeScript/NativeScript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id31492490
octolytics-dimension-repository_network_root_nwoNativeScript/NativeScript
turbo-body-classeslogged-out env-production page-responsive
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseba0ac57287507693938b0a2de45402a22cda0785
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/NativeScript/NativeScript/pull/9875/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FNativeScript%2FNativeScript%2Fpull%2F9875%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
Code QualityEnforce quality at mergehttps://github.com/features/code-quality
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FNativeScript%2FNativeScript%2Fpull%2F9875%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=NativeScript%2FNativeScript
Reloadhttps://github.com/NativeScript/NativeScript/pull/9875/files
Reloadhttps://github.com/NativeScript/NativeScript/pull/9875/files
Reloadhttps://github.com/NativeScript/NativeScript/pull/9875/files
Please reload this pagehttps://github.com/NativeScript/NativeScript/pull/9875/files
NativeScript https://github.com/NativeScript
NativeScripthttps://github.com/NativeScript/NativeScript
Please reload this pagehttps://github.com/NativeScript/NativeScript/pull/9875/files
Notifications https://github.com/login?return_to=%2FNativeScript%2FNativeScript
Fork 1.7k https://github.com/login?return_to=%2FNativeScript%2FNativeScript
Star 25.6k https://github.com/login?return_to=%2FNativeScript%2FNativeScript
Code https://github.com/NativeScript/NativeScript
Issues 771 https://github.com/NativeScript/NativeScript/issues
Pull requests 66 https://github.com/NativeScript/NativeScript/pulls
Discussions https://github.com/NativeScript/NativeScript/discussions
Actions https://github.com/NativeScript/NativeScript/actions
Projects https://github.com/NativeScript/NativeScript/projects
Wiki https://github.com/NativeScript/NativeScript/wiki
Security and quality 0 https://github.com/NativeScript/NativeScript/security
Insights https://github.com/NativeScript/NativeScript/pulse
Code https://github.com/NativeScript/NativeScript
Issues https://github.com/NativeScript/NativeScript/issues
Pull requests https://github.com/NativeScript/NativeScript/pulls
Discussions https://github.com/NativeScript/NativeScript/discussions
Actions https://github.com/NativeScript/NativeScript/actions
Projects https://github.com/NativeScript/NativeScript/projects
Wiki https://github.com/NativeScript/NativeScript/wiki
Security and quality https://github.com/NativeScript/NativeScript/security
Insights https://github.com/NativeScript/NativeScript/pulse
Sign up for GitHub https://github.com/signup?return_to=%2FNativeScript%2FNativeScript%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2FNativeScript%2FNativeScript%2Fissues%2Fnew%2Fchoose
CatchABushttps://github.com/CatchABus
NativeScript:masterhttps://github.com/NativeScript/NativeScript/tree/master
CatchABus:request-layout-fixhttps://github.com/CatchABus/NativeScript/tree/request-layout-fix
Conversation 13 https://github.com/NativeScript/NativeScript/pull/9875
Commits 2 https://github.com/NativeScript/NativeScript/pull/9875/commits
Checks 0 https://github.com/NativeScript/NativeScript/pull/9875/checks
Files changed https://github.com/NativeScript/NativeScript/pull/9875/files
Please reload this pagehttps://github.com/NativeScript/NativeScript/pull/9875/files
fix(ios): Do not call setNeedsLayout() when another layout update request is in process https://github.com/NativeScript/NativeScript/pull/9875/files#top
Show all changes 2 commits https://github.com/NativeScript/NativeScript/pull/9875/files
4803d61 fix(ios): Do not call `requestLayout()` when another layout update is… CatchABus Apr 15, 2022 https://github.com/NativeScript/NativeScript/pull/9875/commits/4803d61517dcc44aff60f1784da8cae1684749ad
35ebb5f fix: Do not prevent call of super class method as it may cause layout… CatchABus Apr 15, 2022 https://github.com/NativeScript/NativeScript/pull/9875/commits/35ebb5f84c9d1d3f32d13914428821af1f01e67d
Clear filters https://github.com/NativeScript/NativeScript/pull/9875/files
Please reload this pagehttps://github.com/NativeScript/NativeScript/pull/9875/files
Please reload this pagehttps://github.com/NativeScript/NativeScript/pull/9875/files
packages/core/ui/core/view/index.ios.tshttps://github.com/NativeScript/NativeScript/pull/9875/files#diff-025d8125f2c2388468769424324a18b7a896921f7b44f720db8014eb653b5f84
View file https://github.com/CatchABus/NativeScript/blob/35ebb5f84c9d1d3f32d13914428821af1f01e67d/packages/core/ui/core/view/index.ios.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/NativeScript/pull/9875/{{ revealButtonHref }}
https://github.com/NativeScript/NativeScript/pull/9875/files#diff-025d8125f2c2388468769424324a18b7a896921f7b44f720db8014eb653b5f84
https://github.com/NativeScript/NativeScript/pull/9875/files#diff-025d8125f2c2388468769424324a18b7a896921f7b44f720db8014eb653b5f84
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.