-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Labels
PubSubRelated to PubSub categoryRelated to PubSub categorybugSomething isn't workingSomething isn't working
Description
Before opening, please confirm:
- I have searched for duplicate or closed issues and discussions.
- I have read the guide for submitting bug reports.
- I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
JavaScript Framework
React
Amplify APIs
PubSub
Amplify Categories
Not applicable
Environment information
I am using [Amplify PubSub to subscribe to an IoT topic ](https://docs.amplify.aws/lib/pubsub/subunsub/q/platform/js/#subscribe-to-a-topic). I want to stop/unsubscribe before sign out. However, there is no mechanism to check/ensure that unsubscribe completed before sign out.
Describe the bug
Sign out happens before unsubscribe completed, therefore, the client (web browser) still subscribe the IoT topic even after sign out.
Expected behavior
The unsubscribe method of PubSub should has a mechanism to inform the status of unsubscribe
Reproduction steps
https://docs.amplify.aws/lib/pubsub/subunsub/q/platform/js/#subscribe-to-a-topic
Code Snippet
const sub1 = PubSub.subscribe('myTopicA').subscribe({
next: data => console.log('Message received', data),
error: error => console.error(error),
complete: () => console.log('Done'),
});
sub1.unsubscribe();
// You will no longer get messages for 'myTopicA'
Log output
// Put your logs below this line
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
Metadata
Metadata
Assignees
Labels
PubSubRelated to PubSub categoryRelated to PubSub categorybugSomething isn't workingSomething isn't working