Rocket.Chat.js.SDK icon indicating copy to clipboard operation
Rocket.Chat.js.SDK copied to clipboard

Connection to driver getting lost/disconnected automatically

Open aswanyaugustine opened this issue 5 years ago • 3 comments

after a particular may be a specific time after there is no new change in subscribed collection (no new message ), the driver getting automatically disconnected due to which new message is not detected

aswanyaugustine avatar Mar 08 '19 04:03 aswanyaugustine

Same here with the api. api.loggedIn() return true, but when I try to do api.get request it return error: "you must be logged into do this". Any help?

galshiff avatar Jan 23 '20 14:01 galshiff

Same problem as @galshiff wrote.. Very strange because the api.loggedIn() return true so i think maybe there is a socket which got somehow disconneced ? Help plz :)

ohadetsion avatar Jan 23 '20 20:01 ohadetsion

Same problem here.. my solution is add an event on_close in asteroid.ddp. This event call main function, and then, reconnect bot.

export const runbot = async () => {
	asteroid = await driver.connect();
	asteroid.ddp.on('socket_close', async () => await runbot());
	await driver.login();
	await driver.subscribeToMessages();
	await driver.respondToMessages(__processMessages);
}

SDK ver. 0.2.9-2

felipetomm avatar Nov 17 '20 19:11 felipetomm