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: use named parameters for postInParallelWithAutomaticChunking #1048

Merged
merged 8 commits into from
Jan 22, 2024

Conversation

trygveu
Copy link
Contributor

@trygveu trygveu commented Jan 12, 2024

There was a mismatch in ordering of parameters that has caused a blocking bug for SLB. They propose a 1-line change, naming the parameters to resolve this issue. PTAL.

Ref: https://cognitedata.atlassian.net/browse/CDF-20687

I don't have full insight into why this needs to happen but this is reported as a bug by SLB, and I need code review on this. Please take a look.
@trygveu trygveu requested review from BugGambit, andersfylling and a team as code owners January 12, 2024 13:53
@andersfylling
Copy link
Contributor

Can you just name all the parameters so we don't have to rely on ordering.
image

@andersfylling andersfylling changed the title Update based on bug reported by SLB fix: use named parameters for postInParallelWithAutomaticChunking Jan 12, 2024
Comment on lines 264 to 268
return this.postInParallelWithAutomaticChunking({
queryParams: params,
path: path,
items: items,
});
Copy link
Contributor

Choose a reason for hiding this comment

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

@saagar-cognite The change looks good to me but I'm not really sure because this could also be a breaking change. Because if callRetrieveEndpoint actually meant to use params and not queryParam then this would break the implementation.

I saw that you were the last one to work on this so mentioning you.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the "proper" fix would be to rename the params prop to something more meaningful like payload, body or whatever it represents.

Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest to send both params & queryParams as both are supported in postInParallelWithAutomaticChunking.
It spread ...params in data while sending to post call.

This option would be safest if this is a time intensive change.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, I could not understand from ticket, what exactly is user trying to send which is not working.
Only thing I could infer is that they actually want to send queryParams but are not able to.

Copy link

Choose a reason for hiding this comment

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

@saagar-cognite could you ask directly in the issue? support might be able to help you get the answer from customer, i dont think they would go inside the PR to answer.

Copy link
Contributor

Choose a reason for hiding this comment

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

@saagar-cognite I update the PR. Looks like the user had the same idea as us. So if they are only using the function from the core package then it should be alright

@samir-ajdarpasic
Copy link
Contributor

Can you just name all the parameters so we don't have to rely on ordering. image

@andersfylling Would love to do that, but that would be a breaking change, don't know if we want to go that way

@samir-ajdarpasic samir-ajdarpasic merged commit db561d0 into master Jan 22, 2024
10 checks passed
@samir-ajdarpasic samir-ajdarpasic deleted the fix/CDF-20687 branch January 22, 2024 08:40
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.

5 participants