amazon-connect / amazon-connect-chatjs

Amazon Connect ChatJS - a browser-based contact center integration API for Chat on the Agent and Customer side.
https://docs.aws.amazon.com/connect/latest/adminguide/what-is-amazon-connect.html
Apache License 2.0
93 stars 54 forks source link

StateError: There is no upstream conduit! #210

Closed SaqibOctave closed 7 months ago

SaqibOctave commented 7 months ago

Hi, I have embeddedthe Streams API in an angular project. I have made a custom UI for messaging using amazon connect and amazon chat-js. It works perfectly good untill i refresh the browser. When i Refresh my browser i check the getContact details in connect.EventType.INIT, i you can see in code snippet,

  connect.core.getEventBus().subscribe(connect.EventType.INIT, ()=>{
      this.connectService.getAgent((agent)=>{
        let agentActiveContacts = agent.getContacts();

        if(agentActiveContacts.length != 0){

            agentActiveContacts.map(async (contact: any) => {
              if(contact.getType() == 'chat'){
                try {
                  const mediaController = await contact.getAgentConnection().getMediaController();
                  console.log("Media controller obtained successfully:", mediaController);
                } catch (err) {
                  console.log("Error obtaining media controller:", err);
                }

              }
            })
          }
      })
    })

as you can see i check for the agent.getContacts(). and my rest of the logic depends on that logic. I got the error Uncaught (in promise): StateError: There is no upstream conduit! StateError: There is no upstream conduit! Can anyone please help to handle browser Refresh case or identify where i am doing wrong.

spenlep-amzn commented 7 months ago

Hi @SaqibOctave , this issue seams directly related to Streams, please raise an issue there: https://github.com/amazon-connect/amazon-connect-streams/issues/new

Going to resolve.

Thanks -Spencer