App crashes when conversation is deleted and user presses navigation buttons #1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Changing any navigation state
Thread 1: EXC_BREAKPOINT (code=1, subcode=0x2188b5e9c)
In ConversationPreviewItem
From that information, it becomes obvious that Swift tries to access data of deleted object when the component (ConversationPreviewItem view) is already long time gone.
Test cases
The following cases all end with switching screen or clicking "add conversation" button or showing/hiding search. At this point app either crashes or not.
Cases when issue occurs
a. One opened chat
b. One non-opened chats
c. Two chats
d. Three chats, deleting last
Cases when issue does not occur
a. Two chats, deleting selected
b. Three chats, deleting first
Conclusion
From my understanding based on tests, regardless of how many chats left in List, you mustn't delete the last one, otherwise it breaks
Possible solution: add fake last item that is not visible to anyone and continue tests.