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: ensure response ordering matches request when chunking a request #893

Merged
merged 2 commits into from
Sep 23, 2022

Conversation

BugGambit
Copy link
Contributor

See this Slack thread for context.

We had a bug when performing a request to the API and the SDK decides to chunk the request into smaller requests. The problem is that we were not guaranteed that the response order matched the input order.

@codecov
Copy link

codecov bot commented Sep 23, 2022

Codecov Report

Merging #893 (fbc77ed) into master (de3557f) will decrease coverage by 4.52%.
The diff coverage is 68.40%.

@@            Coverage Diff             @@
##           master     #893      +/-   ##
==========================================
- Coverage   84.06%   79.54%   -4.53%     
==========================================
  Files          70      105      +35     
  Lines        1952     3329    +1377     
  Branches      249      492     +243     
==========================================
+ Hits         1641     2648    +1007     
- Misses        301      659     +358     
- Partials       10       22      +12     
Impacted Files Coverage Δ
packages/beta/src/cogniteClient.ts 100.00% <ø> (ø)
packages/core/src/httpClient/httpError.ts 90.00% <ø> (ø)
packages/core/src/testUtils.ts 35.59% <0.00%> (-19.58%) ⬇️
packages/stable/src/__tests__/testUtils.ts 96.42% <ø> (-3.58%) ⬇️
packages/stable/src/api/3d/assetMappings3DApi.ts 79.16% <ø> (-20.84%) ⬇️
packages/stable/src/api/3d/nodes3DApi.ts 81.81% <ø> (-18.19%) ⬇️
packages/stable/src/api/3d/revealNodes3DApi.ts 100.00% <ø> (ø)
packages/stable/src/api/3d/revealSectors3DApi.ts 100.00% <ø> (ø)
packages/stable/src/api/3d/revisions3DApi.ts 95.65% <ø> (-4.35%) ⬇️
...kages/stable/src/api/annotations/annotationsApi.ts 100.00% <ø> (ø)
... and 124 more

@@ -129,15 +129,16 @@ describe('Events integration test', () => {
test('descending', async () => {
await client.events.list({ sort: { endTime: SortOrder.DESC } });
});
test('multiple props not supported', async () => {
test('multiple props supported', async () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The events API added support for multiple fields. So the test is not valid anymore.

Copy link
Collaborator

@polomani polomani left a comment

Choose a reason for hiding this comment

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

LGTM 🎉

@BugGambit BugGambit merged commit 77eb797 into master Sep 23, 2022
@BugGambit BugGambit deleted the f1/fix_ordering_promiseall branch September 23, 2022 07:25
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.

2 participants