Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug:unable to capture event after reconnect #2598

Open
fathurayana opened this issue Jan 13, 2025 · 1 comment
Open

bug:unable to capture event after reconnect #2598

fathurayana opened this issue Jan 13, 2025 · 1 comment
Labels

Comments

@fathurayana
Copy link

Describe the bug
Hi Guys , so i have a bug when disconnecting the socket using client.closeConnection(),
when the connection is closed, there are a few message sent, and im trying to reconnect with client.openConnection() ,
there are no event captured, it should capture the previous event , the event start captured when i sending a new message after i reconnect the socket

here is the function that i use to simulate disconnect & reconnect scenario

` const chatClient = useClient({
apiKey: process.env,
userData: { id: data?.user_id, language: "en" },
token: data?.access_token,
});
const simulateDisconnect = () => {
if (chatClient) {
chatClient.closeConnection();
setIsConnected(false);
}

};

const simulateReconnect = async () => {
if (chatClient) chatClient.openConnection();
setIsConnected(true);
};`

To Reproduce

Steps to reproduce the behavior:

  1. disconnect the connection by triggering simulateDisconnect function
  2. send chat from the other device / client to the disconnected client
  3. reconnect the client
  4. see the console for incoming chat event

Expected behavior

the previous event emitted when the connection disconnected should immediately captured when the client reconnect, not when the new message is sent

Additional context

Add any other context about the problem here.

@fathurayana fathurayana added bug Something isn't working status: unconfirmed labels Jan 13, 2025
@MartinCupela
Copy link
Contributor

Hello @fathurayana , I would like to clarify your idea of where the events that are emitted should be accumulated while the device is offline. Could you be more specific on that please?

@MartinCupela MartinCupela added question Support request pending-reply and removed bug Something isn't working status: unconfirmed labels Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants