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

Offline data mode causes isFlutterApp to fail with Null check operator used on a null value #7722

Open
polina-c opened this issue May 8, 2024 · 7 comments
Assignees
Labels
bug Something isn't working P1 high priority issues at the top of the work list, actively being worked on.

Comments

@polina-c
Copy link
Contributor

polina-c commented May 8, 2024

This code in connected_app.dart fails for connected controllers, when loading saved data:

  Future<bool> get isFlutterApp async => _isFlutterApp ??=
      await serviceManager!.libraryUriAvailable(flutterLibraryUri);

It is expected that connected controller should function as normal in offline data mode.

@polina-c
Copy link
Contributor Author

polina-c commented May 8, 2024

cc @kenzieschmoll

@kenzieschmoll
Copy link
Member

Can you provide repro steps? Also, could this have been caused by hot restart robustness issues on web?

@polina-c
Copy link
Contributor Author

polina-c commented May 8, 2024

Steps to repro:

  1. Checkout DevTools at ef553c7
  2. Connect to an app
  3. Open memory screen
  4. Open the data:
    dart_devtools_2024-05-06_17:44:43.187.json
  5. See the error printed in debug console

@polina-c
Copy link
Contributor Author

polina-c commented May 8, 2024

flutter: Null check operator used on a null value
flutter: #0      ConnectedApp.isFlutterApp (package:devtools_app_shared/src/service/connected_app.dart:54:27)
#1      ServiceConnectionManager.rasterCacheMetrics (package:devtools_app/src/service/service_manager.dart:267:35)
#2      MemoryTracker._fetchRasterCacheInfo (package:devtools_app/src/screens/memory/panes/chart/controller/memory_tracker.dart:156:46)
#3      MemoryTracker.pollMemory (package:devtools_app/src/screens/memory/panes/chart/controller/memory_tracker.dart:111:25)
<asynchronous suspension>
#4      ChartVmConnection.init.<anonymous closure> (package:devtools_app/src/screens/memory/panes/chart/controller/chart_connection.dart:81:11)
<asynchronous suspension>
#5      DebounceTimer._runCallback (package:devtools_app/src/shared/utils.dart:264:7)
<asynchronous suspension>

@polina-c
Copy link
Contributor Author

polina-c commented May 8, 2024

Screenshot 2024-05-08 at 12 16 10 PM

@polina-c
Copy link
Contributor Author

polina-c commented May 8, 2024

It also repro on master, but you need to add debug prints before rethrow to see the error.

@kenzieschmoll kenzieschmoll self-assigned this May 23, 2024
@kenzieschmoll kenzieschmoll added bug Something isn't working P1 high priority issues at the top of the work list, actively being worked on. labels May 23, 2024
@kenzieschmoll
Copy link
Member

This issue is caused by the fact that we replace the service manager's connected app with the offline connected app. But on the route underneath the current route showing the offline data, the "online" screen still expects the real connected app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P1 high priority issues at the top of the work list, actively being worked on.
Projects
None yet
Development

No branches or pull requests

2 participants