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

Debugging features are broken after a reload due to missing execution context #2284

Closed
annagrin opened this issue Nov 6, 2023 · 1 comment · Fixed by #2286
Closed

Debugging features are broken after a reload due to missing execution context #2284

annagrin opened this issue Nov 6, 2023 · 1 comment · Fixed by #2286
Assignees

Comments

@annagrin
Copy link
Contributor

annagrin commented Nov 6, 2023

I can only see this internally, after putting a breakpoint in main.dart and reloading the page (could be a new chrome version?)

11:17:32.500 INFO: MetadataProvider: Loading debug metadata...
11:17:32.504 WARNING: RemoteDebuggerExecutionContext: Timed out finding an execution context after 100 ms.
11:17:32.504 SEVERE: AppInspector: Missing execution context ID: Bad state: No context with the running Dart application.
#0      RemoteDebuggerExecutionContext.id (package:dwds/src/debugging/execution_context.dart:65:7)
<asynchronous suspension>
#1      AppInspector.contextId (package:dwds/src/debugging/inspector.dart:186:14)
<asynchronous suspension>
#2      AppInspector._jsCallFunction (package:dwds/src/debugging/inspector.dart:268:31)
<asynchronous suspension>
#3      AppInspector.mapExceptionStackTrace (package:dwds/src/debugging/inspector.dart:778:22)
<asynchronous suspension>
#4      ChromeProxyService._chromeConsoleStreamController.<anonymous closure>.<anonymous closure> (package:dwds/src/services/chrome_proxy_service.dart:1279:29)
<asynchronous suspension>


11:17:32.576 INFO: MetadataProvider: Loaded debug metadata (sound null safety)
11:17:32.576 INFO: ChromeProxyService: Initializing expression compiler for ads/acx2/demo/web/demo_ddc_bundle.app.bootstrap.js with sound null safety: true
11:17:32.652 INFO: ExpressionCompilerService: Updating dependencies...
11:17:32.973 WARNING: RemoteDebuggerExecutionContext: Timed out finding an execution context after 100 ms.
11:17:32.973 SEVERE: AppInspector: Missing execution context ID: Bad state: No context with the running Dart application.
#0      RemoteDebuggerExecutionContext.id (package:dwds/src/debugging/execution_context.dart:65:7)
<asynchronous suspension>
#1      AppInspector.contextId (package:dwds/src/debugging/inspector.dart:186:14)
<asynchronous suspension>
#2      AppInspector._getExtensionRpcs (package:dwds/src/debugging/inspector.dart:755:20)
<asynchronous suspension>
#3      AppInspector.initialize (package:dwds/src/debugging/inspector.dart:121:35)
<asynchronous suspension>
#4      AppInspector.create (package:dwds/src/debugging/inspector.dart:178:5)
<asynchronous suspension>
#5      ChromeProxyService.createIsolate (package:dwds/src/services/chrome_proxy_service.dart:258:18)
<asynchronous suspension>
#6      DevHandler._handleConnectRequest (package:dwds/src/handlers/dev_handler.dart:460:7)
<asynchronous suspension>
#7      DevHandler._handleConnection.<anonymous closure> (package:dwds/src/handlers/dev_handler.dart:268:15)
@annagrin annagrin changed the title Debugging features are broken after a reload due to missing execution xontext Debugging features are broken after a reload due to missing execution context Nov 7, 2023
@annagrin annagrin self-assigned this Nov 7, 2023
@annagrin
Copy link
Contributor Author

annagrin commented Nov 7, 2023

I investigated this a bit - the cause is an exception that an unrelated chrome extension is throwing before the injected client is loaded. We try to map the exception to dart and fail getting dart execution context id, which can be only correctly detected after the injected client is loaded.

We might need to remember the old contexts and periodically try to detect a dart context in them again if the original context detection times out, or make all the operations requiring a context ID tolerant to failure.

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

Successfully merging a pull request may close this issue.

1 participant