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

Batched expressions all fail when any subexpression fails #2551

Open
biggs0125 opened this issue Dec 20, 2024 · 0 comments
Open

Batched expressions all fail when any subexpression fails #2551

biggs0125 opened this issue Dec 20, 2024 · 0 comments
Assignees

Comments

@biggs0125
Copy link
Contributor

Consider the following code:

class A {
  int get foo => 3;
  int get bar => throw 'bad';
}

void main() {
  final a = A();
  debugger(); // <-- stop here
}

Given the shown breakpoint, in DevTools we would expect to be able to expand a and evaluate the subfields of A. We should see something like foo: 3, bar: "Error: bad".

However, dwds tries to batch these expressions and sends a single request to Chrome like [x.foo, x.bar]. This array expression fails to evaluate because one of the subexpressions throws. When the full expression fails, the batch evaluator ends up resolving to an error for every expression in the batch.

DevTools surfaces this as:

Failed to evaluate expression 'x.foo': InternalError: No batch result object ID. 
Failed to evaluate expression 'x.bar': InternalError: No batch result object ID.

Instead we should be showing the correct value for foo and the error thrown for bar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant