Closed gpanshu closed 2 years ago
Not sure how the change in aws-android-sdk-appsync/src/main/java/com/amazonaws/mobileconnectors/appsync/AppSyncOfflineMutationManager.java
is intended to work. Since it's in the constructor, this.connectivityWatcher
will always be null and so the unregister
will never be called.
We see this issue more in our testing where we have a lot of instances of this class each of which has registered a watcher and so we hit the limit when we have a certain number of tests. It would be very useful to have a method on AWSAppSyncClient that would call down in to AppSyncOfflineMutationManager to unregister the callback. We could then call this on test teardown.
Add checks to prevent re-initialization of the connectivityWatcher and unregistering before registering the same watcher to prevent too manyrequests to networkcallback registeration
*Issue #376
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.