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

Crash on older ios devices when adding/removing items dynamically #157

Closed
kryptus36 opened this issue Dec 22, 2019 · 0 comments
Closed

Crash on older ios devices when adding/removing items dynamically #157

kryptus36 opened this issue Dec 22, 2019 · 0 comments

Comments

@kryptus36
Copy link

kryptus36 commented Dec 22, 2019

Which platform(s) does your issue occur on?

  • iOS
  • iOS/Android versions Unsure of exact version
  • emulator or device. What type of device?
    I am testing on an iPhone 6 but same behavior was reported on 7&8.

Works properly in the emulator (tried iPhone 8, 10). Works on physical iPhone 10 & all Androids I tested.

Please, provide the following version numbers that your issue occurs with:

  • CLI: (run tns --version to fetch it) Tested on 6.2.2 and 6.3.0

  • Cross-platform modules: (check the 'version' attribute in the
    node_modules/tns-core-modules/package.json file in your project) Tested on 6.2.2 and 6.3.1

  • Runtime(s): (look for the "tns-android" and "tns-ios" properties in the package.json file of your project)
    6.2.2 and 6.3.0

  • Plugin(s): (look for the version numbers in the package.json file of your
    project and paste your dependencies and devDependencies here)

"dependencies": {
"@nstudio/nativescript-checkbox": "^1.0.0",
"@proplugins/nativescript-purchase": "^2.1.1",
"@types/node": "^12.12.7",
"nativescript-iqkeyboardmanager": "^1.5.1",
"nativescript-pager": "^11.0.11",
"nativescript-plugin-firebase": "^10.1.1",
"nativescript-secure-storage": "^2.6.0",
"nativescript-theme-core": "^2.0.24",
"nativescript-ui-listview": "^7.1.0",
"nativescript-ui-sidedrawer": "^7.0.4",
"tns-android": "^6.2.0",
"tns-core-modules": "^6.3.1"
},
"devDependencies": {
"nativescript": "^6.3.0",
"nativescript-dev-webpack": "^1.1.0-next-2019-07-16-145616-02",
"typescript": "3.4.5"
},

Please, tell us how to recreate the issue in as much detail as possible.

This looks to be a well-known issue in older ios versions.

Describe the steps to reproduce it.

This seems to trigger if:
You use pop() on the observableArray
You use push() on the observableArray multiple times or in a loop

See comments in my code examples (and workarounds in case its useful)

*** Assertion failure in -[UICollectionView _endItemAnimationsWithInvalidationContext:tentativelyForReordering:animator:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKitCore/UIKit-3698.140/UICollectionView.m:6165
***** Fatal JavaScript exception - application has been terminated. *****
Native stack trace:
1 0x101425d50 NativeScript::reportFatalErrorBeforeShutdown(JSC::ExecState*, JSC::Exception*, bool)
2 0x10143c3b4 NativeScript::FFICallbackNativeScript::ObjCBlockCallback::ffiClosureCallback(ffi_cif*, void*, void**, void*)
3 0x101fca9b8 ffi_closure_SYSV_inner
4 0x101fcc1b4 .Ldo_closure
5 0x1efc64a38
6 0x1efc657d4
7 0x1efc13008
8 0x1f01b8b20
9 0x1f01b3a58
10 0x1f01b2fb4 CFRunLoopRunSpecific
11 0x1f23b479c GSEventRunModal
12 0x21ca15c38 UIApplicationMain
13 0x101fcc044 ffi_call_SYSV
14 0x101fca0dc ffi_call_int
15 0x101fc9bd8 ffi_call
16 0x1013e8fe4 NativeScript::FunctionWrapper::call(JSC::ExecState*)
17 0x101f96eb0 llint_entry
18 0x101f942c8 llint_entry
19 0x101f942c8 llint_entry
20 0x101f942c8 llint_entry
21 0x101f942c8 llint_entry
22 0x101f942c8 llint_entry
23 0x101f94220 llint_entry
24 0x101f942c8 llint_entry
25 0x101f75988 vmEntryToJavaScript
26 0x101521c6c JSC::Interpreter::executeCall(JSC::ExecState*, JSC::JSObject*, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
27 0x101dc6e98 JSC::call(JSC::ExecState*, JSC::JSValue, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&, WTF::NakedPtrJSC::Exception&)
28 0x101401550 NativeScript::GlobalObject::moduleLoaderEvaluate(JSC::JSGlobalObject*, JSC::ExecState*, JSC::JSModuleLoader*, JSC::JSValue, JSC::JSValue, JSC::JSValue)
29 0x101c947e0 JSC::JSModuleLoader::evaluate(JSC::ExecState*, JSC::JSValue, JSC::JSValue, JSC::JSValue)
30 0x101f96b6c llint_entry
31 0x101f942c8 llint_entry
JavaScript stack trace:
performBatchUpdatesCompletion(file:///node_modules/nativescript-pager/pager.js:49:0)
at file:///node_modules/nativescript-pager/pager.js:49:0
at UIApplicationMain([native code])
at run(file:///node_modules/@nativescript/core/application/application.js:312:0)
at file:///app/bundle.js:159:16
at ./app.ts(file:///app/bundle.js:169:34)
at webpack_require(file:///app/webpack/bootstrap:74:0)
at checkDeferredModules(file:///app/webpack/bootstrap:43:0)
at webpackJsonpCallback(file:///app/webpack/bootstrap:30:0)
at anonymous(file:///app/bundle.js:2:61)
at evaluate([native code])
at moduleEvaluation([native code])
at [native code]
at asyncFunctionResume([native code])
at [native code]
at promiseReactionJob([native code])
JavaScript error:
file:///node_modules/nativescript-pager/pager.js:49:0: JS ERROR Error: Invalid update: invalid number of items in section 0. The number of items contained in an existing section after the update (3) must be equal to the number of items contained in that section before the update (0), plus or minus the number of items inserted or deleted from that section (1 inserted, 0 deleted) and plus or minus the number of items moved into or out of that section (0 moved in, 0 moved out).
*** JavaScript call stack:
(
0 UIApplicationMain@[native code]
1 run@file:///node_modules/@nativescript/core/application/application.js:312:0
2 @file:///app/bundle.js:159:16
3 ./app.ts@file:///app/bundle.js:169:34
4 webpack_require@file:///app/webpack/bootstrap:74:0
5 checkDeferredModules@file:///app/webpack/bootstrap:43:0
6 webpackJsonpCallback@file:///app/webpack/bootstrap:30:0
7 anonymous@file:///app/bundle.js:2:61
8 evaluate@[native code]
9 moduleEvaluation@:1:11
10 @:2:1
11 asyncFunctionResume@:1:11
12 @:24:9
13 promiseReactionJob@:1:11
)

*** Terminating app due to uncaught exception 'NativeScript encountered a fatal error: Error: Invalid update: invalid number of items in section 0. The number of items contained in an existing section after the update (3) must be equal to the number of items contained in that section before the update (0), plus or minus the number of items inserted or deleted from that section (1 inserted, 0 deleted) and plus or minus the number of items moved into or out of that section (0 moved in, 0 moved out).
at
performBatchUpdatesCompletion(file:///node_modules/nativescript-pager/pager.js:49:0)
at file:///node_modules/nativescript-pager/pager.js:49:0
at UIApplicationMain([native code])
at run(file:///node_modules/@nativescript/core/application/application.js:312:0)
at file:///app/bundle.js:159:16
at ./app.ts(file:///app/bundle.js:169:34)
at webpack_require(file:///app/webpack/bootstrap:74:0)
at checkDeferredModules(file:///app/webpack/bootstrap:43:0)
at webpackJsonpCallback(file:///app/webpack/bootstrap:30:0)
at anonymous(file:///app/bundle.js:2:61)
at evaluate([native code])
at moduleEvaluation([native code])<\M-b\M^@\M-&>

Is there any code involved?

Examples:
https://github.com/kryptus36/pager-crash

I can also reproduce it in the ts demo project, though im not sure exactly why these specific steps trigger the behaviour.

-launch the app
-tap on api demo
-tap back to return to the main page
-swipe several times until you get to slide 9

@triniwiz triniwiz mentioned this issue Feb 22, 2020
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

No branches or pull requests

2 participants