AMITY_MQTT being called too much - Flutter

When running our app the AMITY_MQTT is being called rapidly thus causing lag in our app. How can we fix this?

Hello, let us consult with the team and will get back to you on this. Thank you.

@danielkang98 From the issue you encountered, we have reproduced the reported issues and found no problems. We recommend updating to the latest version. If you continue to experience issues, please provide the following details for further investigation:

  1. Steps to reproduce the case.
  2. Screen recording of the issue.

If you have any additional questions, feel free to ask us.

The issue seems to occur when hot restarting flutter app when developing. This issue is making the app crash during development. Please see the below video to see the problem.

1 Like

@danielkang98 Thank you for the information you provided. I’ll pass this to the relevant team to check, and if I have any updates, I will inform you.

@danielkang98 Regarding your issue, we kindly request that you create a new, blank project and attempt to replicate the issue using our SDK. If you could provide us with detailed steps to reproduce the problem, it would be immensely helpful. Our team has attempted to reproduce it using the latest version but did not encounter the issue you described. We truly appreciate your assistance in this matter.

Hello, the project is too big to start a new blank project to replicate the issue. What I can mention is even when pausing the flutter dev tool, I still get client callback but at a reduced rate. Every hot reload leads to faster rate of callback being called like shown in the video. I wonder why the maximum amount of allowed connection attemps was exceeded is being called. When I pause the dev tool and restart the application (NOT hot restart) it solves the issue but every hot restart I do I get faster and faster client callback being called.

What I can do is share my repository if that will help out solving this issue.

@danielkang98 Could you please check if your code includes this section? If it is correct, you can share your project repository with us so we can further investigate.

 await AmityCoreClient.setup(
        option: AmityCoreClientOption(
            apiKey: apikey,
            httpEndpoint: AmityRegionalHttpEndpoint.US!,
            mqttEndpoint: AmityRegionalMqttEndpoint.US!,
            socketEndpoint:  AmityRegionalSocketEndpoint.US!),
        sycInitialization: true);