Changing any navigation state
Thread 1: EXC_BREAKPOINT (code=1, subcode=0x2188b5e9c)
#3 0x00000001028bb478 in Conversation.recipient.getter at /var/folders/gg/nqnk92m139525f19b5l2b1qr0000gn/T/swift-generated-sources/@__swiftmacro_14Session_Native12ConversationC9recipient18_PersistedPropertyfMa_.swift:9
In ConversationPreviewItem
Avatar(avatar: conversation.recipient.avatar)
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
- Go to conversations screen
- Create conversation
- Open it
- Delete via context menu
b. One non-opened chats
- Go to conversations screen
- Create conversation
- Switch to another screen, go back to reset selection of conversation
- Delete via context menu
c. Two chats
- Go to conversations screen
- Create two conversations
- Select conversation "A"
- Delete conversation "B"
d. Three chats, deleting last
- Go to conversation screen
- Create three conversations
- Delete conversation "C"
Cases when issue does not occur
a. Two chats, deleting selected
- Go to conversation screen
- Create two conversations
- Select conversation "A"
- Delete conversation "A"
b. Three chats, deleting first
- Go to conversation screen
- Create three conversations
- Delete conversation "A"
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.
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.