matrix-org / matrix-org/matrix-rust-sdk
Spurious hard logout on iOS: refresh token rotated by the NSE while the app is suspended mid-refresh
Open
@manuroe is already working on this.
Since Jul 28, 2026.
- Dominant language
- Rust
- Stars
- 2.3k
- Forks
- 500
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 106
Description
The associated Element X iOS rageshake shows that the NSE simply rotated the token while the main app was frozen in the middle of its own token refresh.
When the app resumes, it exchanges the now-stale token. The server then replies with an invalid_grant error and the user gets a hard logout.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.