GetStream / stream-chat-swift

💬 iOS Chat SDK in Swift - Build your own app chat experience for iOS using the official Stream Chat API
https://getstream.io/chat/sdk/ios/
Other
861 stars 210 forks source link

StreamChat creating background tasks and not ending them within 30 seconds #3474

Open dfed opened 1 month ago

dfed commented 1 month ago

What did you do?

I'm not sure. I am seeing the following logs in my app (called "Tolan Dev"):

Background Task 49 ("Called by Tolan Dev.debug.dylib, from $s10StreamChat26IOSBackgroundTaskSchedulerCAA010BackgrounddE0A2aDP05beginD017expirationHandlerSbyycSg_tFTW"), was created over 30 seconds ago. In applications running in the background, this creates a risk of termination. Remember to call UIApplication.endBackgroundTask(_:) for your task in a timely manner to avoid this.

It seems like StreamChat is calling beginBackgroundTask without ending the task gracefully within 30 seconds.

What did you expect to happen?

I expected StreamChat to terminate its background tasks within the required time period

What happened instead?

StreamChat apparently did not terminate its background tasks within the required time period

GetStream Environment

GetStream Chat version: 4.65.0 GetStream Chat frameworks: StreamChat, StreamChatUI iOS version: 18 Swift version: 5 and 6 (depending on module) Xcode version: 16 Device: any

Additional context

I have seen this log crop up a few times. Let me know if there's a way I can grab more logs for you!

nuno-vieira commented 4 weeks ago

Hi @dfed,

Thank you for the report! We will investigate this one as soon as we can.

We will let you know once we start working on it.

Best, Nuno