)]}'
{
  "commit": "0c2832a99ac3a332c4b976905904edc7a89c3512",
  "tree": "573e37f2498545bb9f74a93ae09e6fc1831b68f9",
  "parents": [
    "7af53a860adcfd888a782d3c01ce4385682f9f5d"
  ],
  "author": {
    "name": "John Ryan",
    "email": "ryjohn@google.com",
    "time": "Mon Nov 23 10:26:18 2026 -0800"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Mon Nov 23 10:26:18 2026 -0800"
  },
  "message": "Replace `packageRootUri` with `vmServiceUri` (#10097)\n\n* Replace `packageRootUri` with `vmServiceUri`\n\n This replaces the `packageRootUri` query parameter with `VmServiceUri`\n in `api/serveAvailableExtensions`.\n\nBefore this change, the DevTools app requested the user\u0027s package root file path from the VM service, and passed it along to `api/serveAvailableExtensions` using the `packageRootUri` query parameter. This meant that an untrusted caller could pass any directory on the host fileystem to probe directories or serve extensions outside of the active project directory.\n\nThis deprecates the `packageRootUri` query parameter and replaces it with `vmServiceUri`, which allows the DevTools server to validate `vmServiceUri` and resolve the package root in `VmServiceHandler.detectRootPackageForVmService`.\n\n* Update CHANGELOG\n\n* Apply batched suggestions from code review\n\nCo-authored-by: gemini-code-assist[bot] \u003c176961590+gemini-code-assist[bot]@users.noreply.github.com\u003e\n\n* Apply suggestion from code review\n\n* Fix analyzer warning\n\n* Refactor ExtensionService to use named constructors for each situation\n\n1. ExtensionService() – tracks the current app via the global service connection\n2. ExtensionService.forVmService()– tracks extensions outside the current VSCode workspace.\n3. ExtensionService.forWorkspace - tracks extensions for projects in the user\u0027s current VSCode workspace.\n\n* Remove unneeded check for mainIsolate.value !\u003d null\n\n_refresh() no longer queries the main isolate on the client—it just\npasses serviceConnection.serviceManager.serviceUri to the server.\nSo the mainIsolate.value !\u003d null guard was just a leftover from when the\nclient had to inspect mainIsolate to compute _appRoot.\n\n* use isNullOrEmpty extension method\n\n* Make `_detectExtensions` take two optional parameters\n\n* Revert changes to pubspec.lock\n\n* Address agent feedback\n\n- Record VM service root-detection failures as warnings in `handleServeAvailableExtensions` and still serve static DTD extensions, returning HTTP 500 only when no static extensions are found.\n- Key `_packageRootsForVmServiceConnections` solely by normalized `vmServiceUri.toString()`, normalize arguments in `setPackageRootForVmServiceForTesting`, and remove cached entries on disconnect.\n- Extract `VmServicePackageRootExtension.rootPackageDirectoryForMainIsolate` into `devtools_shared` (`service_utils.dart`) and remove the duplicated logic from `_vm_service.dart`.\n- Deprecate `ServiceManager.connectedAppPackageRoot` in `devtools_app_shared`, delegate it to `VmService.rootPackageDirectoryForMainIsolate`, add a `TODO(johnpryan)` to remove it in the next breaking release, and clean up unused private helpers and imports.\n- Await `ws.ready` in `_connectWithWebSocket` to prevent unhandled `WebSocketChannelException` errors when a VM service connection fails.\n- Add tests for uncached unreachable loopback `vmServiceUri` handling (with and without static extensions) and for cache eviction on VM service disconnect.\n- Update `CHANGELOG.md` in `devtools_shared` and `devtools_app_shared`.\n\n* Simplify ExtensionService constructors\n\n* Remove unused path dependency\n\n* Update comments\n\n* [agent] Address PR review feedback on VM service package root caching and truncated string evaluation.\n\n* Evict `_packageRootsForVmServiceConnections` on disconnect in `handleNotifyForVmServiceConnection` before returning early when DTD or its secret is unavailable.\n* Add a `cacheResult` parameter to `detectRootPackageForVmService` and pass `cacheResult: false` from `handleServeAvailableExtensions` so callers that never send disconnect notifications do not leave stale cache entries, and update the cache doc comment accordingly.\n* Fetch the full string via `getObject` in `_lookupTestTargetPackageRoot` when `VmService.evaluate` returns a truncated `packageConfigLocation` `InstanceRef`.\n* Add unit tests covering disconnect cache eviction without DTD, non-caching root detection, and truncated `packageConfigLocation` evaluation results.\n\n* Address PR review comments on VM service package root detection\n\nThis updates ServiceManager.connectedAppPackageRoot, VmServicePackageRootExtension, and VmServiceHandler to preserve prior isolate-handling behavior and remove unreachable cache eviction logic.\n\n- Await isolateManager.waitForMainIsolateState() in ServiceManager.connectedAppPackageRoot before querying the VM service so early calls on connect wait for the main isolate.\n- Remove the unreachable disconnect cache-eviction path when DTD is unavailable in VmServiceHandler.handleNotifyForVmServiceConnection, along with its doc note and unit test.\n- Return null from VmServicePackageRootExtension.rootPackageDirectoryForMainIsolate when test-target package root lookup fails instead of falling back to a .dart file URI.\n- Catch SentinelException per isolate in _detectMainIsolate and handle null isolate name values safely, with unit tests covering these cases.\n\n* Add comment for `ws.ready`\n\n---------\n\nCo-authored-by: gemini-code-assist[bot] \u003c176961590+gemini-code-assist[bot]@users.noreply.github.com\u003e",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "2ba343c34cd79cedd88a404dc818ba0a46b84957",
      "old_mode": 33188,
      "old_path": "packages/devtools_app/lib/src/extensions/extension_service.dart",
      "new_id": "6e153a4cb6d592acd49dd4da01e262fc021cb5b7",
      "new_mode": 33188,
      "new_path": "packages/devtools_app/lib/src/extensions/extension_service.dart"
    },
    {
      "type": "modify",
      "old_id": "290abeacd493ec9ca8c9582a1eceeb4afa956c75",
      "old_mode": 33188,
      "old_path": "packages/devtools_app/lib/src/shared/server/_extensions_api.dart",
      "new_id": "b8cc6b9265de950e9a745323fcaf0be5e0f5f4b1",
      "new_mode": 33188,
      "new_path": "packages/devtools_app/lib/src/shared/server/_extensions_api.dart"
    },
    {
      "type": "modify",
      "old_id": "1dc6e7e63dd1a67d8902f1d5eb5923d394c5bac6",
      "old_mode": 33188,
      "old_path": "packages/devtools_app/lib/src/standalone_ui/vs_code/devtools/sidebar_extensions_controller.dart",
      "new_id": "b43cbf4049866a01d433f3fb4ca8472e5e576978",
      "new_mode": 33188,
      "new_path": "packages/devtools_app/lib/src/standalone_ui/vs_code/devtools/sidebar_extensions_controller.dart"
    },
    {
      "type": "modify",
      "old_id": "1dfdcb637d382d4ee850b4279a6e7fc74edd5581",
      "old_mode": 33188,
      "old_path": "packages/devtools_app/release_notes/NEXT_RELEASE_NOTES.md",
      "new_id": "9bf254debd642a58d8005fd56e76a82663f35a2a",
      "new_mode": 33188,
      "new_path": "packages/devtools_app/release_notes/NEXT_RELEASE_NOTES.md"
    },
    {
      "type": "modify",
      "old_id": "036c5985fa0ffd6b9ab571383f7532c239d599c1",
      "old_mode": 33188,
      "old_path": "packages/devtools_app/test/extensions/extension_screen_test.dart",
      "new_id": "ec26155d7fa47d75fae6577e08ecdabeb4e71c88",
      "new_mode": 33188,
      "new_path": "packages/devtools_app/test/extensions/extension_screen_test.dart"
    },
    {
      "type": "modify",
      "old_id": "fea1cc26ace8a0045ca07a0a80bafdc632ea65c8",
      "old_mode": 33188,
      "old_path": "packages/devtools_app/test/extensions/extension_service_test.dart",
      "new_id": "28c04326f6daabb9d21aeb31bbcce22696ff5fdb",
      "new_mode": 33188,
      "new_path": "packages/devtools_app/test/extensions/extension_service_test.dart"
    },
    {
      "type": "modify",
      "old_id": "9e172184c88d8edabaa5cfe2f95299ab630ef9f9",
      "old_mode": 33188,
      "old_path": "packages/devtools_app/test/extensions/extension_settings_test.dart",
      "new_id": "0ed74c1b0b0d3b21afb401db4a1700ee3e8c4141",
      "new_mode": 33188,
      "new_path": "packages/devtools_app/test/extensions/extension_settings_test.dart"
    },
    {
      "type": "modify",
      "old_id": "ee3e1246427efc13a0bc5d4a7ab6088f8017840d",
      "old_mode": 33188,
      "old_path": "packages/devtools_app_shared/CHANGELOG.md",
      "new_id": "f12fddc7fd5b5c8c886d002f06a63e9761bb71cf",
      "new_mode": 33188,
      "new_path": "packages/devtools_app_shared/CHANGELOG.md"
    },
    {
      "type": "modify",
      "old_id": "da70413c75aeebf989adb33f7cfa2b99b9e546d1",
      "old_mode": 33188,
      "old_path": "packages/devtools_app_shared/lib/src/service/service_manager.dart",
      "new_id": "7aa4b02ce56596e9b376d8a6c4d6ffb98b76e57a",
      "new_mode": 33188,
      "new_path": "packages/devtools_app_shared/lib/src/service/service_manager.dart"
    },
    {
      "type": "modify",
      "old_id": "786defea6ca2e8c782aa2eac7d64e0a275133f18",
      "old_mode": 33188,
      "old_path": "packages/devtools_app_shared/pubspec.yaml",
      "new_id": "5c6312247b46d149daab104f1c0b6d8b264a2bff",
      "new_mode": 33188,
      "new_path": "packages/devtools_app_shared/pubspec.yaml"
    },
    {
      "type": "modify",
      "old_id": "50bc259549b73050bcec3e8f096b122a3d3f24e0",
      "old_mode": 33188,
      "old_path": "packages/devtools_shared/CHANGELOG.md",
      "new_id": "383137873c1eadb095440cfb3360cf3fbbfdb110",
      "new_mode": 33188,
      "new_path": "packages/devtools_shared/CHANGELOG.md"
    },
    {
      "type": "modify",
      "old_id": "c3d9a7e393f028e43b532948c57b9c59db107a27",
      "old_mode": 33188,
      "old_path": "packages/devtools_shared/lib/src/devtools_api.dart",
      "new_id": "f50595d077bf96f8ae8b5628c388bfaafce09c68",
      "new_mode": 33188,
      "new_path": "packages/devtools_shared/lib/src/devtools_api.dart"
    },
    {
      "type": "modify",
      "old_id": "af2b3f3395771f50e619b43f2596497db2424013",
      "old_mode": 33188,
      "old_path": "packages/devtools_shared/lib/src/server/handlers/_devtools_extensions.dart",
      "new_id": "6cfdd7c2558b44300bc7155665e19d09e9dae7ab",
      "new_mode": 33188,
      "new_path": "packages/devtools_shared/lib/src/server/handlers/_devtools_extensions.dart"
    },
    {
      "type": "modify",
      "old_id": "94fd867e1999ebbc3c1121f5cb513e3b7554000c",
      "old_mode": 33188,
      "old_path": "packages/devtools_shared/lib/src/server/handlers/_vm_service.dart",
      "new_id": "e51f13f30e7d9d31214821b7a2533016eba85953",
      "new_mode": 33188,
      "new_path": "packages/devtools_shared/lib/src/server/handlers/_vm_service.dart"
    },
    {
      "type": "modify",
      "old_id": "f284d7f281fb40679bd3597e51d0f7f164428093",
      "old_mode": 33188,
      "old_path": "packages/devtools_shared/lib/src/server/server_api.dart",
      "new_id": "854eb5bb9cd3314e000084aa03e196ecbc2a1eeb",
      "new_mode": 33188,
      "new_path": "packages/devtools_shared/lib/src/server/server_api.dart"
    },
    {
      "type": "modify",
      "old_id": "00fadb001e5f03eef4f33a0da70130b5080b25cb",
      "old_mode": 33188,
      "old_path": "packages/devtools_shared/lib/src/service/service.dart",
      "new_id": "538f1ed52c8fd438a9ac59a8ee690d3dec204117",
      "new_mode": 33188,
      "new_path": "packages/devtools_shared/lib/src/service/service.dart"
    },
    {
      "type": "modify",
      "old_id": "83ddbc1e2af861d6f7c9d38f23e4fa52cfe8db4c",
      "old_mode": 33188,
      "old_path": "packages/devtools_shared/lib/src/service_utils.dart",
      "new_id": "a148a93a9d90f281a0dae3647f926d9c73594ee9",
      "new_mode": 33188,
      "new_path": "packages/devtools_shared/lib/src/service_utils.dart"
    },
    {
      "type": "modify",
      "old_id": "044d88620bddb58d996f06a25429523591cb0c49",
      "old_mode": 33188,
      "old_path": "packages/devtools_shared/test/server/devtools_extensions_api_test.dart",
      "new_id": "d50505effc23eb7bc7549f7e67527584549a9873",
      "new_mode": 33188,
      "new_path": "packages/devtools_shared/test/server/devtools_extensions_api_test.dart"
    },
    {
      "type": "modify",
      "old_id": "f0902307d637d465cf8fcebe86f79f30343bfff3",
      "old_mode": 33188,
      "old_path": "packages/devtools_shared/test/server/general_api_test.dart",
      "new_id": "c2d2aedf1b04bed928b58b8bcd106fb628651933",
      "new_mode": 33188,
      "new_path": "packages/devtools_shared/test/server/general_api_test.dart"
    },
    {
      "type": "modify",
      "old_id": "8222163f6761795f7277b6b2715753f8d42df2b9",
      "old_mode": 33188,
      "old_path": "packages/devtools_shared/test/service_utils_test.dart",
      "new_id": "84f8b811f931b1446c009973942afb34b12de9da",
      "new_mode": 33188,
      "new_path": "packages/devtools_shared/test/service_utils_test.dart"
    }
  ]
}
