Browser refresh: StateError: There is no upstream conduit

0

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, as 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);
                }
                
              }
            })
          }
      })
    })

According to documentation promise resolve to a ChatSession.

Gets a Promise with the media controller associated with this connection. The promise resolves to a ChatSession object from amazon-connect-chatjs library.

But i got the error here that

Uncaught (in promise): StateError: There is no upstream conduit! StateError: There is no upstream conduit!

Can you please help me to findout the problem that where i got wrong?

S_Ali
asked 2 months ago130 views
1 Answer
0

Hello,

From the error, I believe it is happening when try to fetch some information from the code. Kindly check the HAR file to find more information for the error and further troubleshoot the issue.

[+] https://github.com/amazon-connect/amazon-connect-streams/blob/master/src/index.d.ts

AWS
answered 2 months ago
profile picture
EXPERT
reviewed a month ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions