amazon-connect / amazon-connect-streams

Amazon Connect Streams - a browser-based contact center integration API, typically with CRM systems.
https://docs.aws.amazon.com/connect/latest/userguide/
Apache License 2.0
395 stars 315 forks source link

Manual log out does not trigger TERMINATED event #907

Open ajspetner opened 3 months ago

ajspetner commented 3 months ago

When manually triggering logout per the documentation as such:

fetch("https://<your-instance-domain>/connect/logout", { credentials: 'include', mode: 'no-cors'})
  .then(() => {
    const eventBus = connect.core.getEventBus();
    eventBus.trigger(connect.EventType.TERMINATE);
  });

The TERMINATED event is never triggered, contrary to the documentation.

ajspetner commented 2 months ago

@seiyako shouldn't this be labeled as a bug, since it is not working as per the documentation?

hngan commented 2 months ago

Yes, this is a known bug that we'll be fixing as part of introducing a new set of logout/login helper APIs. In the meantime, you can do a hack and replace eventBus.trigger(connect.EventType.TERMINATE); with connect.core.getUpstream().sendUpstream(connect.EventType.TERMINATE). This will work as a temporary workaround, but I can't guarantee that this to be a permanent solution.