samagra-comms / uci-web-channel

Web channel for UCI
https://uci-web-channel-prod.vercel.app/#/
11 stars 48 forks source link

BOT again starts from initial as soon as connection is lost. #28

Open Abhay-86 opened 2 years ago

Abhay-86 commented 2 years ago

Description

Like as soon as socket get disconnected we have to start with initial message(Hi UCI) again but bot should start from where it had interrupted.

How to reproduce

If connection is lost during conversation.

bishalpandit commented 2 years ago

I might like to work on this issue. A datastore like redis can help in this as when we receive messages we store the message with a specific ID in redis and after client reconnects we check for that ID and retrieve and start from where we were.

ChakshuGautam commented 2 years ago

Hey @bishalpandit the root cause of the issue right now is the there is no mapping of the physical device to the socket connection that they are making. Right now every socket connection is a new device for us. So this is more of an authentication issue - which should give us the user using the bot. If we know exactly which user is using the frontend, we can resume the conversation from where they left as UCI saves the state on its end.

Currently UCI thinks it's a new user every time, therefore creates a new session and starts the bot fresh.

I would recommend you start with the OTP issue #12 for this.

bishalpandit commented 2 years ago

okay got it @ChakshuGautam! Checking the OTP issue for now.

bishalpandit commented 2 years ago

@ChakshuGautam I see that the OTP issue has already been assigned! I will wait for new issues.