open-bounty icon indicating copy to clipboard operation
open-bounty copied to clipboard

Status team member check taking an awful amount of time

Open vitvly opened this issue 7 years ago • 3 comments

Type: Bug

Description

commiteth.github.core.status-team-member? fn is invoked during initial user profile loading, and it can take up to 4-5 seconds to complete. It checks whether currently logged-in user is a member of Status org on GitHub or belongs to Status team. If the return value is true, Usage Metrics tab becomes visible. Execution times are so long due to multiple GitHub API queries.

The problem is that user profile data is not initialized completely until it finishes, and this may result in longer wait times for e.g. 'My Payment Details' screen to load.

Solution

  • Perhaps use some kind of whitelisting instead, so that no API calls are involved
  • Or separate this check from user profile loading, so that it runs asynchronously

vitvly avatar Feb 08 '18 16:02 vitvly

@siphiuel How could it be easily reproduced in production? I'm trying to get that delay but can't feel it right now. :S

pablodip avatar Feb 09 '18 13:02 pablodip

The delay will be there once https://github.com/status-im/open-bounty/pull/263 is merged. It causes the queries to /api/user to execute longer.

vitvly avatar Feb 09 '18 13:02 vitvly

Aah, okay! :)

pablodip avatar Feb 09 '18 13:02 pablodip