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

Improve efficiency of API calls #146

Open
1 of 4 tasks
blms opened this issue Feb 25, 2021 · 1 comment
Open
1 of 4 tasks

Improve efficiency of API calls #146

blms opened this issue Feb 25, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@blms
Copy link
Member

blms commented Feb 25, 2021

  • More efficient auth callbacks
  • Pool together groups reqs instead of hitting /api/groups a bunch
  • Pool together name reqs instead of hitting /api/user a bunch
  • Better caching
@blms blms added the enhancement New feature or request label Feb 25, 2021
@blms
Copy link
Member Author

blms commented Mar 9, 2021

We should only need to hit the auth endpoints when the user session object needs to be updated. The user object contains:

{
  id: '1',
  name: 'Test User',
  firstName: 'Test',
  lastName: 'User',
  email: '[email protected]',
  affiliation: 'Jest Tests',
  groups: [{
    id: 'abcd1234', name: 'Test Group', ownerName: 'Test User', memberCount: 2, role: 'owner',
  }],
  createdAt: '2881-10-05T14:48:00.000',
  updatedAt: '2881-10-05T14:48:00.000',
};

So we need to update the session object when:

  • User changes their name or affiliation
  • User joins a group
  • User added to a group
  • User leaves a group
  • User is removed from a group
  • User's role in a group changes
  • Group changes its name
  • Group membership number changes
  • Group is deleted

Otherwise we don't need to make an API query to update the user object, we can just store it from login or whatever was the last change. We just need to make sure that the user object we're using everywhere is consistent and retains any updates made since login.

@blms blms changed the title Improve efficiency of auth callbacks Improve efficiency of API calls Apr 5, 2021
blms added a commit that referenced this issue Apr 9, 2021
blms added a commit that referenced this issue Apr 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant