Skip to content
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

Implement pre-loading and cache for account management URLs #4460

Open
bmarty opened this issue Jan 6, 2025 · 0 comments
Open

Implement pre-loading and cache for account management URLs #4460

bmarty opened this issue Jan 6, 2025 · 0 comments

Comments

@bmarty
Copy link
Contributor

bmarty commented Jan 6, 2025

An API is exposed to get the external urls used to managed the account:
fun accountUrl(action: AccountManagementAction?).

The applications are using this API to display the 2 settings entries "Manage account" and "Manage devices", if the respective returned URL are not null, and on click action open the webpage, see below:

image

But this API is performing network request and so can be slow to return, or can even fail when there is no network.
This will lead the application to:

  • not show the entries in the root setting screen (no network)
  • delay the display of the entries (slow network)

To solve this, the SDK should prefetch the URL for the actions AccountManagementAction.Profile and AccountManagementAction.SessionsList, in order to speed up the return of the method fun accountUrl(action: AccountManagementAction?).
Not sure when the cache should expire, it's maybe safer to always fetch the URL at each client creation.

Note: mechanism used to pre-fetch data about the user, such as avatarUrl and displayName could be reused to solve this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant