Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit a75607ca authored by Fahim Salam Chowdhury's avatar Fahim Salam Chowdhury 👽 Committed by Fahim M. Choudhury
Browse files

fix: resolve Notes app's synchronization fail issue with SSO

If a user is logged in using OIDC for Murena account, the access token is only refreshed on CalDAV & CardDAV. The sync happens there either forcefully by user, or periodically in every \~15 minutes. The Notes app reuses the same token; it doesn't check or update the token.

In a corner case, when DAV syncs are not happening in the next 'X' minutes, but the token's Time-to-Live (TTL) is expired, and the user opens the Notes app at that time, then the API will return 401. To resolve this, we need to refresh the token before the notes API request is made.

The AppAuth library in AccountManager uses a callback function to notify when the token refresh is done. But we want the request to be synchronous because the Notes app's request is synchronous. Hence, we had to rely on Kotlin's runBlocking() method to make the refresh() call blocking and synchronous.
parent f979e8a3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment