Skip to content
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

App Crashes when ChatThreadListController is synchronized in ChatThreadListVC or our own VC #3363

Closed
ChangLiu-Sidebar opened this issue Aug 7, 2024 · 3 comments
Labels
🐞 Bug An issue or PR related to a bug 🌐 SDK: StreamChat (LLC) Tasks related to the StreamChat LLC SDK

Comments

@ChangLiu-Sidebar
Copy link

What did you do?

I tried 3 scenarios.

  1. Without using ChatThreadListController nor ChatThreadListVC, background the app and foreground the app, no crash.
  2. Create a ChatThreadListVC and navigate to it. Background the app and foreground the app. app crash
  3. Do not use ChatThreadListVC but build our own VC using ChatThreadListController. Call ChatThreadListController.sychronize() in setUp() function. Background the app and foreground the app. app crash

What did you expect to happen?

The app should not crash

What happened instead?

The app crashed with the following error:
"StreamChat/DatabaseContainer.swift:255: Fatal error: Background context is read only, but calling actions() created changes"

GetStream Environment

GetStream Chat version:
GetStream Chat frameworks: StreamChat, StreamChatUI
iOS version:
Swift version:
Xcode version: 15.1
Device: iPhone Pro 15 Simulator

Additional context

I added some breakpoints and this is the stack triggering the fatal error
Screenshot 2024-08-07 at 4 29 45 PM
Also, if I disconnect the streamClient after enter background, the app will not crash when foreground. However, if I reconnect after foreground, it still crashed.

@ChangLiu-Sidebar
Copy link
Author

Another finding, if I downgrade to 4.59.0, the issue is gone.

@nuno-vieira
Copy link
Member

Hi @ChangLiu-Sidebar,

Yes this an assertion actually, and on production it won't crash, but this is a known issue and it will be fixed on the next version 👍

We will let you know once we release it.

Best,
Nuno

@nuno-vieira nuno-vieira added 🐞 Bug An issue or PR related to a bug 🌐 SDK: StreamChat (LLC) Tasks related to the StreamChat LLC SDK labels Aug 7, 2024
@nuno-vieira
Copy link
Member

This is now fixed on the latest release.

Thank you,
Nuno

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 Bug An issue or PR related to a bug 🌐 SDK: StreamChat (LLC) Tasks related to the StreamChat LLC SDK
Projects
None yet
Development

No branches or pull requests

2 participants