line72 / helplightning-libpurple

Help Lightning plugin for libpurple
GNU General Public License v3.0
0 stars 0 forks source link

Fail to send message when session token expires #12

Closed line72 closed 1 year ago

line72 commented 1 year ago

After 8 hours from our initial message, we start getting errors when sending a message. It's a token expired, so we correctly refresh the user token, but we still get the error.

I though there was a logic error in the refresh, but the issue is that the session_send_message is authorized by a session token, NOT a user token! We are caching the token in our session object, and never updating it!

We need a way to refresh this.

We might be able to add a custom errback in the libgaldr_send_im_to that handles as 1003 (expired token) and removes the session from our acct->sessions. This would cause us to call session_create_with to get an updated version of the session.

line72 commented 1 year ago

Merged in master in 431a83e650bbd75d869d954a960962563c695d45