-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Remove All is randomly crashing the app, out of bounds #2155
Comments
I don't think you need to call |
yea that was probably an attempt to force the app to enter a consistent state before the intended changes |
i've stumble on this do you think that wrapping my |
It might help. Have you tried it? |
We are currently testing it but like I said I haven't been able to reproduce it. If it passes in QA we will archive the bug and see if re-appears. |
Seeing the same issue here. Only appearing in production, can't reproduce in QA. Eureka version: 5.3.4
And the relevant code:
|
We are also seeing another crash that may be relevant here. Here's the stacktrace:
|
@chickendiver is the purpose of your code to completely reset the form? You could try just creating a form on a separate variable and end with For example: let newForm = Form()
newForm +++ ...
<<< ...
self.form = newForm This should avoid lots of removing and adding to the form |
This is awesome, thank you! We've implemented this solution, and it appears to be working great in our QA environment. Will monitor in prod. |
Wrapping removeAll calls in beginUpdates/endUpdates fixed it for me: [formViewController.]tableView.beginUpdates()
[formViewController.]form.removeAll()
[formViewController.]tableView.endUpdates() You can read why it happens here: https://openradar.appspot.com/36072360 There Apple replied recommending to place data source mutation and table view modification inside batch updates blocks or begin/end calls. That way the table will refresh when endUpdates is called, and not before. Basically form.removeAll removes from the data source and updates the table but it does not do it in one go. So the table sometimes thinks an item still exists in the data source when it doesn't, causing the crash. |
@mats-claassen Have you seen the post above? |
Hi @alexanderhenne, yes I have seen it. I haven't heard of any issues in a while. As the Form does not have direct access to tableView or controller, the way you do it seems reasonable (as opposed to including that logic inside form. removeAll). Also it has to be noted that form.removeAll will eventually trigger a call to |
I am still getting this issue randomly on certain devices. Specifically on an iPhone 11 with iOS 17.7.0, the build was created with Xcode 16 with iOS 18 support. Snippet of the crash log:
|
I'm unable to reproduce it but it keeps happening.
xcode 12.4 (12D4e)
Eureka 5.3.3
iOS 14.4.2
basically we create the section once, then we have refresh our specific section by deleting all rows and recreating them.
It might be trigger by viewDidAppear or Observers watching Realm
I've already tried to use both eureka removeAll functions.
removeAll(keepingCapacity keepCapacity: Bool = false)
public func removeAll(where shouldBeRemoved: (BaseRow) throws -> Bool) rethrows {
I've tried different aproches to refresh just the lines/section what we need to
The number of objects to add might be from 0 to 3
The last crash happen when the application was going to foreground.
i've also check:
#2048
#2141
it was already happening in the previous version we were using
The text was updated successfully, but these errors were encountered: