-
Notifications
You must be signed in to change notification settings - Fork 358
Closed
Copy link
Description
We started noticing an issue recently on Element X (both platforms) which goes something along these lines:
- Launch the app when both the access token and the cached
ServerInfo(which contains/versionsdata) have expired. - The SDK attempts to make a
/versionsrequest. - As of Upgrade Ruma #5789, Ruma now includes the access token on
/versionsmeaning that the following error is returnedApi(Server(ClientApi(Error { status_code: 401, body: Standard { kind: UnknownToken { soft_logout: false }, message: "Token is not active" } })))
- The SDK sees that error and attempts to refresh the access token.
- Refreshing the access token via MAS requires knowledge of the authentication server so a
get_authorization_server_metadatarequest is sent. - A
get_authorization_server_metadatarequest requires knowledge of the supported/versionsin order to build the correct path. - Bad things happen™️
In practice we've seen this manifest in 2 different ways:
- The session is restored and navigation throughout the app works, but the SDK only ever sends
/versionsrequests no matter what you attempts to do. - Whilst setting up the session,
SyncServiceBuilder::finishthrows the following error which (on EXI at least) we handle with a fatal errorGeneric(msg: "the server returned an error: [401 / M_UNKNOWN_TOKEN] Token is not active", details: Optional("RoomList(SlidingSync(Http(Api(Server(ClientApi(Error { status_code: 401, body: Standard { kind: UnknownToken { soft_logout: false }, message: \"Token is not active\" } }))))))"))