-
Notifications
You must be signed in to change notification settings - Fork 45
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
Expired access tokens require manual intervention (e.g. "soft_logout") #173
Comments
Hm, you're the first user to report having a token be expired. I saw an addition to the Matrix spec allowing for that, but I didn't know it was actually happening in the wild. Thanks for reporting. |
An |
@phil-s Please try this branch: https://github.com/alphapapa/ement.el/tree/wip/soft-logout When the server does a soft-logout, Ement should tell you to run Once that is verified to work, I'll see about adding support for the refresh token. |
Thank you; I didn't get to this on the weekend, but expect to be able to test it this week. |
I don't have time to debug this right now I'm afraid, but this isn't working for me at this point. I'm using the new branch with plz 0.7. When the session expired and I attempted to send a message, I got:
After looking at the new commits I saw I then got:
I've redacted most of the data from the very large backtrace for that one:
That's all I have right now, and I'm about to restart the session manually, so I won't be able to continue from the above state later. (I may be in a position to repeat this on our staging Matrix instance, though.) |
@phil-s Sorry, just a simple oversight on my part. Please pull the branch again and let me know if it works next time. |
Will do. I've disconnected and restarted Emacs to make sure I'm testing from a sane state. I could test the Ooh. Ok, ement got into a loop trying to connect. In the messages buffer I see:
...repeatedly until I ran |
...and that could have been a blunder on my part with the |
@phil-s Hm, that's weird. The error from Anyway, I just pushed a few more changes/fixes, so please pull again. If you get any similar errors, please Thanks for your help. |
And, as you mentioned:
I don't know of such a way, but please let me know if you discover one. :) |
Another issue related to
I was getting that consistently trying to post a message in a room after the refresh/reconnect. I then managed to open a second buffer for the same room from the rooms list, and that one allowed me to send messages. A bit later I managed to trigger this:
|
Thanks, another simple oversight. I should move that slot's initial value into the struct definition like I did for the events table. |
I'm hoping to take a look at this again later in the week, so any pointers for debugging the reconnection process would be gratefully accepted. (Last time I tested I believe I was still ending up needing to forcibly disconnect and reconnect to get the client working again, so I'm pretty sure more work is needed here.) |
I'm not sure exactly what you mean by "reconnection process," since Matrix is constantly opening new connections for receiving new events. (Forgive my being pedantic, but as I'm sure you can testify to, being specific early on can save time from miscommunication later on.) For the, shall we say, reauthentication or relogin process, my best general advice is to use Edebug on the |
Yes indeed. I'm afraid my lack of familiarity with the protocols is going to make me unintentionally ambiguous at times, so my apologies for that. (I'm still kinda hoping to get away without having to learn how Matrix works in detail.) |
No problem. I don't blame you for not wanting to wade in too deep. :) As generally pleasant and simple as Matrix's basic design is, it's still growing and changing, which can be tedious to keep up with. |
Retargeting for v0.14. |
With session saving in play, after this happens:
It appears to be necessary to (after disconnecting) manually edit the saved session file and remove the invalid entry before attempting to reconnect.
Without doing that, running
ement-disconnect
and thenement-connect
results in a HTTP 401 error due to the invalid token, and it does not attempt to reauthenticate and nor does it purge the invalid session from the file, so trying again will simply produce the same result:The text was updated successfully, but these errors were encountered: