Skip to content

[vm_service] VmServerConnection does not handle SentinelExceptions as prescribed by the vm service interface #51752

@annagrin

Description

@annagrin

VmServerConnection seems to convert SentinelException to an RPC error. This has caused flakes in flutter web tests:

Parent issue: flutter/flutter#121708

The issue above currently has a PR that resolves it for one case, but we should have a reliable solution that works for all vm service API and their clients, to prevent more hard-to-detect failures due to inconsistencies in checks.

Details

dwds' chrome proxy service throws a sentinel exception on getIsolate for non-existing isolate id, as required by the VmServiceInterface:

Future<Isolate> getIsolate(String isolateId);

but the VmServerConnection translates it into an RPC error with RPCError.kInternalError as code, and the sentinel is added to the message as a string:

final error = e is RPCError

The clients then need to check for the string contents to contain a sentinel kind. See flutter/flutter#122776 (comment) for a client check example.

Should we change the VmServerConnection to throw something different, or have a set of error codes in package:vm_service we all agree on in servers and clients can check for in their code?

Metadata

Metadata

Assignees

Labels

P2A bug or feature request we're likely to work onarea-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.customer-fluttertriagedIssue has been triaged by sub teamvm-serviceThe VM Service Protocol, both the specification and its implementation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions