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

Fix leak in ChatService.disconnectChatSession. #42

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dejanbor
Copy link

**Issue Number: - **

Description:

ChatService.disconnectChatSession is leaking resources because it is not calling completion block on all its paths. Because of that its clients will hang forever waiting for completion block to be called. This will further lead to leaked tasks (or continuations if SDK users wrap callback APIs into async-await continuations) in the application that uses amazon-connect-chat-ios SDK.

This fix ads call to completion block at the place where it was missing. Assumption is that if chat session is not active, and we call disconnect, we should consider this as successful disconnection.


Functional backward compatibility:

Does this change introduce backwards incompatible changes? NO

Does this change introduce any new dependency? NO


Testing:

Is the code unit tested?
No.

Have you tested the changes with a sample UI (e.g. iOS Mobile Chat Example)?

No, we detected the leaks/crashes in our application and tracked the root cause. The bug is obvious by just looking at the ChatService.disconnectChatSession code, so there is no point in trying to test it on sample UI.

@dejanbor dejanbor requested a review from a team as a code owner November 27, 2024 00:20
@dejanbor dejanbor requested review from mliao95 and chauhuynh97 and removed request for a team November 27, 2024 00:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant