poe-api icon indicating copy to clipboard operation
poe-api copied to clipboard

RuntimeError: Response timed out.

Open aqasemi opened this issue 1 year ago • 2 comments

Is anyone else here still getting this error message after setting up a client for quite a bit of time?

The user message is sent to poe.com successfully, but not received by the websocket.

When I run a basic app in my local machine it just works fine most of the time, but when I run it inside a container it raises this error message after just an hour or two of running. Maybe the problem is within the container itself? Idk.

My first and most obvious solution was to refresh the client every since and while. But I didn't find this practical because the websocket disconnects after random periods of time, sometimes after an hour, and some other times after just about ten minutes. And also because that when using that method, it was more likely that my account was going to be banned, or so I think.

aqasemi avatar Jul 09 '23 14:07 aqasemi

I ended up making a function that gets the messages history of a particular bot and look up the missing message (ones that weren't caught by the websocket. i.e. when a runtime error arises.) after it yields the missing message it basically calls another function whose sole role is to reset the websocket connection.

aqasemi avatar Jul 09 '23 21:07 aqasemi

Same problem I have encountered. One possibility is the websocket was disconnected abnormally after a random time while the Poe program still thought the websocket to be connected. My workaround is setting the ws_connected value to False before the first message of every conversation (a conversation may contain several messages), so that the websocket will reconnect before every first message while not reconnect during different messages in one conversation.

ichuixue avatar Jul 15 '23 07:07 ichuixue