awslabs / aws-mobile-appsync-sdk-ios

iOS SDK for AWS AppSync.
https://awslabs.github.io/aws-mobile-appsync-sdk-ios/
Other
262 stars 128 forks source link

AWS subscriptions - subscribe function is not thread safe and causes crashes #568

Closed Vanyaslav closed 9 months ago

Vanyaslav commented 1 year ago

Describe the bug When subscribing on multiple threads the connection pool is causing crashes since it accesses a dictionary inside the class IAMBasedConnectionPool which is not thread safe.

To Reproduce Steps to reproduce the behavior:

  1. Create multiple subscribers with AWS App sync on multiple threads.
  2. Enjoy the crashing app.

Expected behavior It should be a thread safe operation to avoid crashes.

Screenshots

Screenshot 2023-04-13 at 09 52 07 Screenshot 2023-04-13 at 10 02 37

Environment(please complete the following information):

Device Information (please complete the following information):

Additional context We use the framework kinda extensively, but with iOS16.4 and AppSync v. 3.6.2 the problem has gone to really a bad situation, while before we had experienced the crash less frequently. Already prepared a fix , gonna send a PR soon.

atierian commented 9 months ago

Resolved by https://github.com/awslabs/aws-mobile-appsync-sdk-ios/pull/569