Sum Ting Wong
Sum Ting Wong

Reputation: 1

React Chat Engine: Insufficient resources

I have this ReactJS code:

import {Card, Flex } from 'antd'
import SessionStorage from '../../../stores/sessionStore';
import {MultiChatSocket, MultiChatWindow, useMultiChatLogic} from 'react-chat-engine-advanced'

function ChatContent() {

  const sessionStorageInstance = SessionStorage.getInstance();
  const user = sessionStorageInstance.getUserData()

  const chatProps = useMultiChatLogic(
    projectID,
    username,
    secret,
  )

  return (
    <div style={{flex: 1}}>
        <Flex vertical >
            <Card style={{padding: '20px'}}>
              <div style={{height: '100vh'}}>
                <MultiChatSocket {...chatProps}/>
                <MultiChatWindow {...chatProps} style={{height: '100vh'}}/>
              </div>
            </Card>
        </Flex>
    </div>
  )
}

The first time I open the browser it works fine, but as soon as I try to add a new user to the chat or remove some group chat members I receive an error, and changes are not visible until I refresh the browser.

The error message is: WebSocket connection to 'wss://api.chatengine.io/person_v4/?session_token='/sometoken' failed: Insufficient resources

ReactJS version: ^18.2.0, and "react-chat-engine-advanced": "^0.1.28",

Expecting to Web Chat working fine.

Upvotes: 0

Views: 36

Answers (0)

Related Questions