-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
AssertionFailure #5
Comments
@mschonvogel Hi I never checked it with RxDataSources. But it should not be something big. Most likely I am missing something in my math. Can you please provide an example where I can play around with it? Also, so I can start quicker, can you add print to the ChatLayout.prepare(forCollectionViewUpdates:) and print updateItems for me. I need a log what RXDataSource sends there before you hit an assertion. It seems to be pretty straight forward. For some reason there is less items than the index that is in the item array. Thank you. |
@mschonvogel At the first look it seems that RXDataSources flattens somehow the update commands. |
@mschonvogel
If ypu wont get a crash It will give me some ideas about what is going on. But of corse an example with the crash is ideal. |
@ekazaev thank you for the quick reply I've added RxDataSources to the example but I'm not able to replicate the bug in there: https://github.com/mschonvogel/ChatLayout/tree/rxdatasources print("(updateItems)"): [D(0,0), D(0,1), R(0,30)]
Fatal error: Internal inconsistency: file ChatLayout/SectionModel.swift, line 155 |
Thank you @mschonvogel |
Thank you @ekazaev. Btw replacing the block at line 514 helped, it's not hitting the assertionFailure anymore. However,
|
@mschonvogel That is absolutely normal that the I can offer you to have a call so we can have a look at your particular situation together. |
@ekazaev Okay, I found the problem. 🤦♂️ I am using a Firebase Firestore query listener with a limit of 25. Whenever I insert a new message, an older one gets deleted. that's why the deletes were at the beginning of the collection. Now everything looks fine when I insert a new message...: I'll test this some more, but everything should work as expected now. I'm happy to jump on a call, to test the changes you made to the lib if it helps |
@mschonvogel Good to know. Thank you. Please do not hesitate to contact me on twitter @ekazaev |
Thank you, it works as expected now! |
@mschonvogel Fantastic! Happy to hear! |
Hey, first of all, good work with this library! 🙂 I switched from MessageKit.
I use ChatLayout with RxDataSources and somehow every now and then I'm getting an assertion failure when adding a new message.
I have not yet looked at the layout in detail and wondered if you might know what the problem could be?
The text was updated successfully, but these errors were encountered: