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

Lot of request on user role change #3225

Open
lmmrssa opened this issue Feb 20, 2019 · 1 comment
Open

Lot of request on user role change #3225

lmmrssa opened this issue Feb 20, 2019 · 1 comment

Comments

@lmmrssa
Copy link
Member

lmmrssa commented Feb 20, 2019

When we change user role it takes a while to reflect that change. It can be experienced on EARTH as there are lot of users from different communities.
Tried to activate one of the user
screen shot 2019-02-20 at 13 26 24
On background it made lot of request. Then only it reflect the change.
screen shot 2019-02-20 at 13 27 36

It is fetching whole list and updating the view. So we need to change that to just fetch changes.

@paulbert
Copy link
Member

The requests that it makes are here:

this.couchService.findAll(this.dbName, { 'selector': {}, 'limit': 100 }),
this.couchService.findAll('login_activities', { 'selector': {}, 'limit': 100 }),
this.couchService.findAll('child_users', { 'selector': {} }),
this.couchService.findAll('communityregistrationrequests', { 'selector': { 'registrationRequest': 'accepted' } })

The first quick way to reduce the number of requests made would be to remove the 'limit': 100 from the first two functions. This will revert those to the default for findAll which is 1000.

Second, longer term fix is to set these databases up with the StateService which controls storing the data from the databases and running a /_changes request to the database to only fetch new or updated documents after the first findAll.

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

2 participants