Open massi-ang opened 1 year ago
In addition to this, it would be useful to provide a disconnect()
method on the PubSub
object to be able to clean up resources.
@massi-ang, thank you for opening this issue. Was this an existing app that you migrated/updated to the newly released v6 and experienced this? Or was this a freshly built app using v6?
This was a new testing app I created, and basically consists of only that App.tsx file
Hi @massi-ang,
Thank you for prividing the detailed code snippet. It helps a lot! We are currently investigating the issue and will keep you post in this threat.
Before opening, please confirm:
JavaScript Framework
React
Amplify APIs
Authentication, PubSub
Amplify Categories
No response
Environment information
Describe the bug
When setting the
clientId
in the PubSub client to a fixed value to enforce security best practices (such as creating a least privilege policy to limit the connection with a specificclientId
only), the application enters an infinite connection loop, as the client tries to connect with the same ID causing a DUPLICATE_CLIENT_ID disconnection error.Expected behavior
The client connects
Reproduction steps
Create a React app, add Amplify PubSub as per documentation Additionally set the
clientId
to a fixed valueCode Snippet
Log output
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response