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

fix: break up profiles into batches of 50 #1091

Merged
merged 6 commits into from
Nov 4, 2022
Merged

fix: break up profiles into batches of 50 #1091

merged 6 commits into from
Nov 4, 2022

Conversation

neekolas
Copy link
Contributor

@neekolas neekolas commented Nov 3, 2022

What does this PR do?

  • We realized the Lens API doesn't allow you to query for more than 50 profiles at a time, but also doesn't offer pagination when querying by profileIds. So, we are breaking the request into smaller chunks.
  • Bonus is that when a new conversation is added it will only query for the one new profile instead of the whole batch

Fixes # (issue)

CleanShot.2022-11-03.at.13.45.18.mp4

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Enhancement (non-breaking small changes to existing functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How should this be tested?

  • Have > 50 different conversations open. All should load. (More easily tested by lowering the MAX_PROFILES_TO_LOAD_CONCURRENTLY variable)

@neekolas neekolas requested a review from bigint as a code owner November 3, 2022 20:49
@vercel
Copy link

vercel bot commented Nov 3, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
lenster ✅ Ready (Inspect) Visit Preview Nov 3, 2022 at 11:57PM (UTC)

@vercel vercel bot temporarily deployed to Preview November 3, 2022 20:50 Inactive
@vercel vercel bot temporarily deployed to Preview November 3, 2022 22:33 Inactive
@vercel vercel bot temporarily deployed to Preview November 3, 2022 22:35 Inactive
@vercel vercel bot temporarily deployed to Preview November 3, 2022 22:41 Inactive
@vercel vercel bot temporarily deployed to Preview November 3, 2022 23:57 Inactive
Comment on lines +70 to +73
apolloClient.query({
query: ProfilesDocument,
variables: { request: { profileIds: profileIdChunk } }
})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: I think we can use useLazyQuery hook here 🤔, if we use apolloClient all the apollo config will not be applied here

@bigint
Copy link
Member

bigint commented Nov 4, 2022

Merging this now, cuz its breaking prod 🙏🏼

@bigint bigint merged commit 9b96277 into main Nov 4, 2022
@bigint bigint deleted the pagination-fix branch November 4, 2022 02:46
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

Successfully merging this pull request may close these issues.

None yet

2 participants