Skip to content
This repository was archived by the owner on Sep 14, 2025. It is now read-only.
This repository was archived by the owner on Sep 14, 2025. It is now read-only.

App crashes when conversation is deleted and user presses navigation buttons #1

Description

@VityaSchel

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

  1. Go to conversations screen
  2. Create conversation
  3. Open it
  4. Delete via context menu

b. One non-opened chats

  1. Go to conversations screen
  2. Create conversation
  3. Switch to another screen, go back to reset selection of conversation
  4. Delete via context menu

c. Two chats

  1. Go to conversations screen
  2. Create two conversations
  3. Select conversation "A"
  4. Delete conversation "B"

d. Three chats, deleting last

  1. Go to conversation screen
  2. Create three conversations
  3. Delete conversation "C"

Cases when issue does not occur

a. Two chats, deleting selected

  1. Go to conversation screen
  2. Create two conversations
  3. Select conversation "A"
  4. Delete conversation "A"

b. Three chats, deleting first

  1. Go to conversation screen
  2. Create three conversations
  3. 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions