Skip to content

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

@dfed

Description

@dfed

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    🌐 SDK: StreamChat (LLC)Tasks related to the StreamChat LLC SDK🐞 BugAn issue or PR related to a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions