Possible Unhandled Promise Rejection: Error: INVALID_STATE_ERR

Hi,

I am trying to subscribe to all topics by following the tutorial. But, it didn’t work.
So, I started to break that function into multiple individual calls to find out what is failing. I observed the function “CometChat.getJoinedGroups()” is failing and gives the warning I mentioned in. the title.
Here, is the code snippet of function I am calling in my app

export const TestSubscription = async () => {
    try {
        let user = await CometChat.getLoggedinUser()
        console.log('Logged in user', user)
        let groups = await CometChat.getJoinedGroups();
        console.log('Joined Groups', groups)
    } catch (error) {
        console.log('Error', error)
    }
}

In my app log I see the the user object getting logged and after that it shows the same warning.

Logged in user {“authToken”: “MY_AUTH_TOKEN”, “blockedByMe”: false, “hasBlockedMe”: false, “lastActiveAt”: 1590072223, “name”: “USER_NAME”, “role”: “customer”, “uid”: “MY_UID”}

WARN Possible Unhandled Promise Rejection (id: 3):

Error: INVALID_STATE_ERR

I am suspecting because of this it is not able to subscribe to all topics.

My Environment Details:
react-native: 0.61.5
@cometchat-pro/react-native-chat: 2.0.8

I am using functional components and react Hooks in my project if that matters.

Hello @Rohit_Augmento,

Are you running a development server with the hot reload on? If yes, I would advise you to turn off the hot reload. Also can you please confirm that you are facing the same issue on release build?

Hello @Rohit_Augmento

Apologies for the late response.

We are working on implementing token based Push Notification and you can track the feature request here

Regards,
Prathamesh.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.