Skip to content

fix(LRO): remove redundant call to /operations/{id}/result when no location header is present#69

Merged
may-hartov merged 2 commits intomicrosoft:mainfrom
may-hartov:dev/mahartov/lro_polling_bug_fix
Nov 24, 2025
Merged

fix(LRO): remove redundant call to /operations/{id}/result when no location header is present#69
may-hartov merged 2 commits intomicrosoft:mainfrom
may-hartov:dev/mahartov/lro_polling_bug_fix

Conversation

@may-hartov
Copy link
Copy Markdown
Collaborator

@may-hartov may-hartov commented Nov 19, 2025

Summary

  • Updated the _poll_operation function to check for the presence of a Location header before fetching operation results, ensuring correct handling of operation responses. If the Location header is not present, the response status code is set to 200 and the original response is returned.

Context
When the CLI receives a success response from the LRO API, it automatically calls /operations/{id}/result to retrieve the result payload. However, this payload is only available when the operation returns success and includes a Location header in the response. If the header is missing, the /result call is unnecessary and will return the error operationHasNoResult.

@may-hartov may-hartov requested a review from a team as a code owner November 19, 2025 09:49
@aviatco
Copy link
Copy Markdown
Collaborator

aviatco commented Nov 23, 2025

@may-hartov can you please add unit test verify this case? that we skip the second call in case no headers

@may-hartov may-hartov merged commit a2f771b into microsoft:main Nov 24, 2025
9 checks passed
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.

4 participants