Skip to content

Request to retrieve API token can take a long time #3965

Closed

Description

@bjester

Observed behavior

When loading the account settings page, the API token is retrieved as a separate async request. The request seems to also calculate the user's storage usage, meaning the request can take a while and during that time, the API token field appears empty to the user.

Expected behavior

Separate the request for the API token from any storage usage calculation and add appropriate loading indicators for user feedback on the page's loading state.

User-facing consequences

Confusion on why the API token isn't appearing
https://learningequality.slack.com/archives/C0LK8QS9J/p1677751140708559

Activity

  1. akash5100 commented on Mar 9, 2023

    @akash5100
    Contributor

    Hello! I hope you're doing well. I came across this issue and I would be delighted to contribute to it. Would you be able to show me the files that are involved?

  2. vkWeb commented on Mar 9, 2023

    @vkWeb
    Contributor

    @akash5100 in the backend, this is the function that gets called by the frontend.

    I think @bjester sir is expecting you to separate the calls -- request.user.get_space_used_by_kind() and request.user.get_token() into two API endpoints. So that the expensive calculations of request.user.get_space_used_by_kind() does not affect API token loading.

    @bjester sir, am I guiding @akash5100 on the right direction?

  3. bjester commented on Mar 9, 2023

    @bjester
    MemberAuthor

    Yes that's right, thanks @vkWeb!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions