-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
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:
sdk/pkg/vm_service/lib/src/vm_service.dart
Line 690 in 67f3e1f
| 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:
sdk/pkg/vm_service/lib/src/vm_service.dart
Line 1795 in 67f3e1f
| 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?