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

getLongRunningPoller not working if response definitions are the same between operations #2913

Open
MaryGao opened this issue Nov 15, 2024 · 0 comments
Assignees
Labels
p0 priority 0 RLC

Comments

@MaryGao
Copy link
Member

MaryGao commented Nov 15, 2024

We have reported similar modular issue but this issue still exists in RLC.

Say we have Foo and Bar responses and we would generate below overloadings. But if the definition of these two operations are the same or Bar is subset of Foo's, our overloading would be not working. This is because TypeScript is duck-typing it compares the definition with shape not interface names.

This usually happened in LRO operations where the initial response is the same but the final response is different. So we can't correctly predict the logical response.

export function getLongRunningPoller(
  response: FooResponse | FooDefaultResponse,
): response is FooDefaultResponse | FooLogicalResponse ;

export function getLongRunningPoller(
  response: BarResponse | BarDefaultResponse,
): response is BarDefaultResponse | BarLogicalResponse;

The same issue would happen in isUnexpected helper.

@MaryGao MaryGao changed the title getLongRunningPoller not working if one model is a subset of another model in RLC getLongRunningPoller not working if response definitions are the same between operations Nov 15, 2024
@qiaozha qiaozha added HRLC p0 priority 0 RLC and removed HRLC labels Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p0 priority 0 RLC
Projects
None yet
Development

No branches or pull requests

2 participants