-
Notifications
You must be signed in to change notification settings - Fork 1
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: fetch all referenced entities #507
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
expect(mockClient.withoutLinkResolution.getEntries).toHaveBeenNthCalledWith(11, { | ||
'sys.id[in]': params.ids, | ||
locale: 'en-US', | ||
skip: 90, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is skip
expected to be 90
here? It looks from the previous request that the fetch started from skip: 0
and limit: 20
.
I thought that after an error the next request should have parameters skip: 0
and limit: 10
. Unless I misunderstood something
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, no, sorry, I understand it now.
100 / 10 = 10 per batch. 1 request failed , so 10 + 1 request is the last one to fetch the remaining 10 items. All good :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works correctly. Love it! Also big thanks for the tests - really stellar piece of work!
Screen.Recording.2024-03-20.at.17.27.03.mov
This reverts commit 099dcd6.
Purpose
Previously we only fetched 100 referenced entities. So for experiences with more than 100 entities bound, we only render 100 entities.
This PR fetches all bound entities in chunks of 100.
If we encounter a response too big error during fetch, we reduce the limit and try fetching again.
Screen.Recording.2024-03-20.at.15.37.47.mov
Approach