From b032aa56156a30c039d81368ece40aa50bc043c5 Mon Sep 17 00:00:00 2001 From: Kelvin Amoaba <97001695+AmoabaKelvin@users.noreply.github.com> Date: Sun, 8 Nov 2026 19:12:26 +0000 Subject: [PATCH] feat(runtime): tell phones which settings changed (#39718) * feat(runtime): tell phones which settings changed * test(mobile): re-record Source Control goldens for the settings stream --- ...-git.changes-load-git.branchcompare-1.json | 226 +++++++-------- .../matrix-git.changes-load-git.status-1.json | 266 +++++++++--------- .../matrix-git.changes-load-repo.list-1.json | 226 +++++++-------- ...trix-git.changes-load-worktree.show-1.json | 226 +++++++-------- .../goldens/sc-changes-loaded.json | 142 +++++----- .../sc-changes-return-from-memory.json | 98 +++---- .../goldens/sc-changes-write-reads-live.json | 104 +++---- mobile/src/query/host-event-router.test.ts | 166 +++++++++++ mobile/src/query/host-event-router.ts | 150 +++++++--- mobile/src/query/host-query.ts | 11 +- mobile/src/query/settings-change-signal.ts | 35 +++ .../mobile-agent-launch-queries.ts | 13 +- .../use-mobile-new-tab-agent-options.ts | 8 +- ...bile-source-control-settings-operations.ts | 14 +- .../mobile-source-control-settings.ts | 8 +- .../runtime-settings-change-events.test.ts | 46 +++ .../runtime-settings-change-events.ts | 25 ++ src/main/runtime/orca-runtime.ts | 2 + src/shared/host-runtime-capabilities.ts | 4 + src/shared/runtime-client-events.ts | 2 + 20 files changed, 1083 insertions(+), 689 deletions(-) create mode 100644 mobile/src/query/host-event-router.test.ts create mode 100644 mobile/src/query/settings-change-signal.ts create mode 100644 src/main/runtime/client/settings/runtime-settings-change-events.test.ts create mode 100644 src/main/runtime/client/settings/runtime-settings-change-events.ts diff --git a/mobile/rpc-foundation/goldens/matrix-git.changes-load-git.branchcompare-1.json b/mobile/rpc-foundation/goldens/matrix-git.changes-load-git.branchcompare-1.json index b7969499141..1a61e065e8a 100644 --- a/mobile/rpc-foundation/goldens/matrix-git.changes-load-git.branchcompare-1.json +++ b/mobile/rpc-foundation/goldens/matrix-git.changes-load-git.branchcompare-1.json @@ -252,6 +252,38 @@ } } }, + "3088889ce80e": { + "name": "settings.get#1", + "ordinal": 2, + "args": [ + { + "name": "method", + "value": "settings.get" + }, + { + "name": "params", + "value": { + "$rpc": "undefined" + } + }, + { + "name": "options", + "value": { + "failWhenDisconnected": true + } + } + ], + "settlement": { + "status": "rejected", + "startedAt": 0, + "settledAt": 0, + "error": { + "category": "Error", + "message": "Connection closed", + "isRpcDeliveryUnknown": true + } + } + }, "4533fb49ac71": { "branchCompareState": { "kind": "error", @@ -342,38 +374,6 @@ "ordinal": 11, "json": "{\"id\":\"frame-6\",\"deviceToken\":\"recording-device\",\"method\":\"git.branchCompare\",\"params\":{\"worktree\":\"id:repo42::/p\",\"baseRef\":\"origin/dev\"}}" }, - "63bc0796d81c": { - "name": "settings.get#1", - "ordinal": 1, - "args": [ - { - "name": "method", - "value": "settings.get" - }, - { - "name": "params", - "value": { - "$rpc": "undefined" - } - }, - { - "name": "options", - "value": { - "failWhenDisconnected": true - } - } - ], - "settlement": { - "status": "rejected", - "startedAt": 0, - "settledAt": 0, - "error": { - "category": "Error", - "message": "Connection closed", - "isRpcDeliveryUnknown": true - } - } - }, "6a0cb0684d8b": { "name": "git.branchCompare#1", "ordinal": 10, @@ -592,32 +592,6 @@ } } }, - "891438a18444": { - "name": "settings.get#1", - "ordinal": 1, - "args": [ - { - "name": "method", - "value": "settings.get" - }, - { - "name": "params", - "value": { - "$rpc": "undefined" - } - }, - { - "name": "options", - "value": { - "failWhenDisconnected": true - } - } - ], - "settlement": { - "status": "pending", - "startedAt": 0 - } - }, "8fda864c66d6": { "branchCompareState": { "kind": "loading" @@ -823,6 +797,32 @@ } } }, + "b823fdc0d205": { + "name": "settings.get#1", + "ordinal": 2, + "args": [ + { + "name": "method", + "value": "settings.get" + }, + { + "name": "params", + "value": { + "$rpc": "undefined" + } + }, + { + "name": "options", + "value": { + "failWhenDisconnected": true + } + } + ], + "settlement": { + "status": "pending", + "startedAt": 0 + } + }, "bd638c43a536": { "name": "git.branchCompare#1", "ordinal": 10, @@ -933,11 +933,6 @@ } } }, - "e539e80d06e9": { - "name": "runtime.clientEvents.subscribe#1", - "ordinal": 2, - "json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"runtime.clientEvents.subscribe\",\"params\":null}" - }, "eb79a9b3682a": { "status": "fulfilled", "startedAt": 0, @@ -946,6 +941,11 @@ "$rpc": "undefined" } }, + "eef1ee3c2773": { + "name": "runtime.clientEvents.subscribe#1", + "ordinal": 1, + "json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"runtime.clientEvents.subscribe\",\"params\":null}" + }, "fa79ca4a1a0d": { "name": "git.branchCompare#1", "ordinal": 10, @@ -1052,8 +1052,8 @@ { "id": "sc-changes-loaded.prelude:status-pending", "observation": { - "sender": ["891438a18444", "2ab4c978da8d"], - "payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"], + "sender": ["b823fdc0d205", "2ab4c978da8d"], + "payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"], "settlements": { "mount": "eb79a9b3682a" }, @@ -1064,9 +1064,9 @@ { "id": "sc-changes-loaded.prelude:compare-pending", "observation": { - "sender": ["891438a18444", "962f91336a50", "6f4a5d6a5a86", "1934c215114a"], + "sender": ["b823fdc0d205", "962f91336a50", "6f4a5d6a5a86", "1934c215114a"], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1083,14 +1083,14 @@ "id": "sc-changes-loaded.prelude:cleanup", "observation": { "sender": [ - "63bc0796d81c", + "3088889ce80e", "962f91336a50", "74d102469d68", "2ca33da4d135", "b7127d77e6aa" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1108,14 +1108,14 @@ "id": "sc-changes-loaded.normal:settled", "observation": { "sender": [ - "891438a18444", + "b823fdc0d205", "962f91336a50", "74d102469d68", "2ca33da4d135", "5d30d477f0d5" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1133,14 +1133,14 @@ "id": "sc-changes-loaded.normal:cleanup", "observation": { "sender": [ - "63bc0796d81c", + "3088889ce80e", "962f91336a50", "74d102469d68", "2ca33da4d135", "5d30d477f0d5" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1158,14 +1158,14 @@ "id": "sc-changes-loaded.result-absent:settled", "observation": { "sender": [ - "891438a18444", + "b823fdc0d205", "962f91336a50", "74d102469d68", "2ca33da4d135", "fa79ca4a1a0d" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1183,14 +1183,14 @@ "id": "sc-changes-loaded.result-absent:cleanup", "observation": { "sender": [ - "63bc0796d81c", + "3088889ce80e", "962f91336a50", "74d102469d68", "2ca33da4d135", "fa79ca4a1a0d" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1208,14 +1208,14 @@ "id": "sc-changes-loaded.result-null:settled", "observation": { "sender": [ - "891438a18444", + "b823fdc0d205", "962f91336a50", "74d102469d68", "2ca33da4d135", "86eb3bc4e90c" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1233,14 +1233,14 @@ "id": "sc-changes-loaded.result-null:cleanup", "observation": { "sender": [ - "63bc0796d81c", + "3088889ce80e", "962f91336a50", "74d102469d68", "2ca33da4d135", "86eb3bc4e90c" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1258,14 +1258,14 @@ "id": "sc-changes-loaded.inner-ok-missing:settled", "observation": { "sender": [ - "891438a18444", + "b823fdc0d205", "962f91336a50", "74d102469d68", "2ca33da4d135", "dc48d55bec67" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1283,14 +1283,14 @@ "id": "sc-changes-loaded.inner-ok-missing:cleanup", "observation": { "sender": [ - "63bc0796d81c", + "3088889ce80e", "962f91336a50", "74d102469d68", "2ca33da4d135", "dc48d55bec67" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1308,14 +1308,14 @@ "id": "sc-changes-loaded.inner-false-string-error:settled", "observation": { "sender": [ - "891438a18444", + "b823fdc0d205", "962f91336a50", "74d102469d68", "2ca33da4d135", "bd638c43a536" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1333,14 +1333,14 @@ "id": "sc-changes-loaded.inner-false-string-error:cleanup", "observation": { "sender": [ - "63bc0796d81c", + "3088889ce80e", "962f91336a50", "74d102469d68", "2ca33da4d135", "bd638c43a536" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1358,14 +1358,14 @@ "id": "sc-changes-loaded.inner-false-object-error:settled", "observation": { "sender": [ - "891438a18444", + "b823fdc0d205", "962f91336a50", "74d102469d68", "2ca33da4d135", "047f0b230543" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1383,14 +1383,14 @@ "id": "sc-changes-loaded.inner-false-object-error:cleanup", "observation": { "sender": [ - "63bc0796d81c", + "3088889ce80e", "962f91336a50", "74d102469d68", "2ca33da4d135", "047f0b230543" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1408,14 +1408,14 @@ "id": "sc-changes-loaded.outer-refused:settled", "observation": { "sender": [ - "891438a18444", + "b823fdc0d205", "962f91336a50", "74d102469d68", "2ca33da4d135", "97a020d83f3c" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1433,14 +1433,14 @@ "id": "sc-changes-loaded.outer-refused:cleanup", "observation": { "sender": [ - "63bc0796d81c", + "3088889ce80e", "962f91336a50", "74d102469d68", "2ca33da4d135", "97a020d83f3c" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1458,14 +1458,14 @@ "id": "sc-changes-loaded.outer-refused-no-message:settled", "observation": { "sender": [ - "891438a18444", + "b823fdc0d205", "962f91336a50", "74d102469d68", "2ca33da4d135", "6a0cb0684d8b" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1483,14 +1483,14 @@ "id": "sc-changes-loaded.outer-refused-no-message:cleanup", "observation": { "sender": [ - "63bc0796d81c", + "3088889ce80e", "962f91336a50", "74d102469d68", "2ca33da4d135", "6a0cb0684d8b" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1508,14 +1508,14 @@ "id": "sc-changes-loaded.method-not-found:settled", "observation": { "sender": [ - "891438a18444", + "b823fdc0d205", "962f91336a50", "74d102469d68", "2ca33da4d135", "7506958819b1" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1533,14 +1533,14 @@ "id": "sc-changes-loaded.method-not-found:cleanup", "observation": { "sender": [ - "63bc0796d81c", + "3088889ce80e", "962f91336a50", "74d102469d68", "2ca33da4d135", "7506958819b1" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1558,14 +1558,14 @@ "id": "sc-changes-loaded.transport-rejection:settled", "observation": { "sender": [ - "891438a18444", + "b823fdc0d205", "962f91336a50", "74d102469d68", "2ca33da4d135", "fdcce09eef21" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1583,14 +1583,14 @@ "id": "sc-changes-loaded.transport-rejection:cleanup", "observation": { "sender": [ - "63bc0796d81c", + "3088889ce80e", "962f91336a50", "74d102469d68", "2ca33da4d135", "fdcce09eef21" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1608,14 +1608,14 @@ "id": "sc-changes-loaded.transport-rejection-no-message:settled", "observation": { "sender": [ - "891438a18444", + "b823fdc0d205", "962f91336a50", "74d102469d68", "2ca33da4d135", "2cca3e7f3f9b" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1633,14 +1633,14 @@ "id": "sc-changes-loaded.transport-rejection-no-message:cleanup", "observation": { "sender": [ - "63bc0796d81c", + "3088889ce80e", "962f91336a50", "74d102469d68", "2ca33da4d135", "2cca3e7f3f9b" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", diff --git a/mobile/rpc-foundation/goldens/matrix-git.changes-load-git.status-1.json b/mobile/rpc-foundation/goldens/matrix-git.changes-load-git.status-1.json index 8944f49a991..bf13a7571d4 100644 --- a/mobile/rpc-foundation/goldens/matrix-git.changes-load-git.status-1.json +++ b/mobile/rpc-foundation/goldens/matrix-git.changes-load-git.status-1.json @@ -379,6 +379,38 @@ } } }, + "3088889ce80e": { + "name": "settings.get#1", + "ordinal": 2, + "args": [ + { + "name": "method", + "value": "settings.get" + }, + { + "name": "params", + "value": { + "$rpc": "undefined" + } + }, + { + "name": "options", + "value": { + "failWhenDisconnected": true + } + } + ], + "settlement": { + "status": "rejected", + "startedAt": 0, + "settledAt": 0, + "error": { + "category": "Error", + "message": "Connection closed", + "isRpcDeliveryUnknown": true + } + } + }, "393d2f9f3485": { "name": "git.status#1", "ordinal": 3, @@ -484,38 +516,6 @@ "ordinal": 11, "json": "{\"id\":\"frame-6\",\"deviceToken\":\"recording-device\",\"method\":\"git.branchCompare\",\"params\":{\"worktree\":\"id:repo42::/p\",\"baseRef\":\"origin/dev\"}}" }, - "63bc0796d81c": { - "name": "settings.get#1", - "ordinal": 1, - "args": [ - { - "name": "method", - "value": "settings.get" - }, - { - "name": "params", - "value": { - "$rpc": "undefined" - } - }, - { - "name": "options", - "value": { - "failWhenDisconnected": true - } - } - ], - "settlement": { - "status": "rejected", - "startedAt": 0, - "settledAt": 0, - "error": { - "category": "Error", - "message": "Connection closed", - "isRpcDeliveryUnknown": true - } - } - }, "6d2d788a9e84": { "name": "git.status#1", "ordinal": 3, @@ -629,32 +629,6 @@ } ] }, - "891438a18444": { - "name": "settings.get#1", - "ordinal": 1, - "args": [ - { - "name": "method", - "value": "settings.get" - }, - { - "name": "params", - "value": { - "$rpc": "undefined" - } - }, - { - "name": "options", - "value": { - "failWhenDisconnected": true - } - } - ], - "settlement": { - "status": "pending", - "startedAt": 0 - } - }, "8fda864c66d6": { "branchCompareState": { "kind": "loading" @@ -866,6 +840,32 @@ } ] }, + "b823fdc0d205": { + "name": "settings.get#1", + "ordinal": 2, + "args": [ + { + "name": "method", + "value": "settings.get" + }, + { + "name": "params", + "value": { + "$rpc": "undefined" + } + }, + { + "name": "options", + "value": { + "failWhenDisconnected": true + } + } + ], + "settlement": { + "status": "pending", + "startedAt": 0 + } + }, "cb462f8b50a3": { "name": "worktree.show#1", "ordinal": 8, @@ -882,11 +882,6 @@ } ] }, - "e539e80d06e9": { - "name": "runtime.clientEvents.subscribe#1", - "ordinal": 2, - "json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"runtime.clientEvents.subscribe\",\"params\":null}" - }, "eb79a9b3682a": { "status": "fulfilled", "startedAt": 0, @@ -895,6 +890,11 @@ "$rpc": "undefined" } }, + "eef1ee3c2773": { + "name": "runtime.clientEvents.subscribe#1", + "ordinal": 1, + "json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"runtime.clientEvents.subscribe\",\"params\":null}" + }, "f0896523e780": { "name": "git.status#2", "ordinal": 6, @@ -959,8 +959,8 @@ { "id": "sc-changes-loaded.prelude:status-pending", "observation": { - "sender": ["891438a18444", "2ab4c978da8d"], - "payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"], + "sender": ["b823fdc0d205", "2ab4c978da8d"], + "payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"], "settlements": { "mount": "eb79a9b3682a" }, @@ -971,8 +971,8 @@ { "id": "sc-changes-loaded.prelude:cleanup", "observation": { - "sender": ["63bc0796d81c", "1dbb1f085bde"], - "payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"], + "sender": ["3088889ce80e", "1dbb1f085bde"], + "payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"], "settlements": { "mount": "eb79a9b3682a" }, @@ -983,9 +983,9 @@ { "id": "sc-changes-loaded.normal:compare-pending", "observation": { - "sender": ["891438a18444", "962f91336a50", "6f4a5d6a5a86", "1934c215114a"], + "sender": ["b823fdc0d205", "962f91336a50", "6f4a5d6a5a86", "1934c215114a"], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1002,14 +1002,14 @@ "id": "sc-changes-loaded.normal:settled", "observation": { "sender": [ - "891438a18444", + "b823fdc0d205", "962f91336a50", "74d102469d68", "2ca33da4d135", "5d30d477f0d5" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1027,14 +1027,14 @@ "id": "sc-changes-loaded.normal:cleanup", "observation": { "sender": [ - "63bc0796d81c", + "3088889ce80e", "962f91336a50", "74d102469d68", "2ca33da4d135", "5d30d477f0d5" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1051,8 +1051,8 @@ { "id": "sc-changes-loaded.result-absent:compare-pending", "observation": { - "sender": ["891438a18444", "f186683ccf2d"], - "payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"], + "sender": ["b823fdc0d205", "f186683ccf2d"], + "payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"], "settlements": { "mount": "eb79a9b3682a" }, @@ -1063,8 +1063,8 @@ { "id": "sc-changes-loaded.result-absent:settled", "observation": { - "sender": ["891438a18444", "f186683ccf2d"], - "payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"], + "sender": ["b823fdc0d205", "f186683ccf2d"], + "payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"], "settlements": { "mount": "eb79a9b3682a" }, @@ -1075,8 +1075,8 @@ { "id": "sc-changes-loaded.result-absent:cleanup", "observation": { - "sender": ["63bc0796d81c", "f186683ccf2d"], - "payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"], + "sender": ["3088889ce80e", "f186683ccf2d"], + "payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"], "settlements": { "mount": "eb79a9b3682a" }, @@ -1087,8 +1087,8 @@ { "id": "sc-changes-loaded.result-null:compare-pending", "observation": { - "sender": ["891438a18444", "9ae4367a6ff8"], - "payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"], + "sender": ["b823fdc0d205", "9ae4367a6ff8"], + "payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"], "settlements": { "mount": "eb79a9b3682a" }, @@ -1099,8 +1099,8 @@ { "id": "sc-changes-loaded.result-null:settled", "observation": { - "sender": ["891438a18444", "9ae4367a6ff8"], - "payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"], + "sender": ["b823fdc0d205", "9ae4367a6ff8"], + "payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"], "settlements": { "mount": "eb79a9b3682a" }, @@ -1111,8 +1111,8 @@ { "id": "sc-changes-loaded.result-null:cleanup", "observation": { - "sender": ["63bc0796d81c", "9ae4367a6ff8"], - "payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"], + "sender": ["3088889ce80e", "9ae4367a6ff8"], + "payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"], "settlements": { "mount": "eb79a9b3682a" }, @@ -1123,8 +1123,8 @@ { "id": "sc-changes-loaded.inner-ok-missing:compare-pending", "observation": { - "sender": ["891438a18444", "19fff093880d"], - "payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"], + "sender": ["b823fdc0d205", "19fff093880d"], + "payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"], "settlements": { "mount": "eb79a9b3682a" }, @@ -1135,8 +1135,8 @@ { "id": "sc-changes-loaded.inner-ok-missing:settled", "observation": { - "sender": ["891438a18444", "19fff093880d"], - "payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"], + "sender": ["b823fdc0d205", "19fff093880d"], + "payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"], "settlements": { "mount": "eb79a9b3682a" }, @@ -1147,8 +1147,8 @@ { "id": "sc-changes-loaded.inner-ok-missing:cleanup", "observation": { - "sender": ["63bc0796d81c", "19fff093880d"], - "payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"], + "sender": ["3088889ce80e", "19fff093880d"], + "payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"], "settlements": { "mount": "eb79a9b3682a" }, @@ -1159,8 +1159,8 @@ { "id": "sc-changes-loaded.inner-false-string-error:compare-pending", "observation": { - "sender": ["891438a18444", "393d2f9f3485"], - "payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"], + "sender": ["b823fdc0d205", "393d2f9f3485"], + "payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"], "settlements": { "mount": "eb79a9b3682a" }, @@ -1171,8 +1171,8 @@ { "id": "sc-changes-loaded.inner-false-string-error:settled", "observation": { - "sender": ["891438a18444", "393d2f9f3485"], - "payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"], + "sender": ["b823fdc0d205", "393d2f9f3485"], + "payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"], "settlements": { "mount": "eb79a9b3682a" }, @@ -1183,8 +1183,8 @@ { "id": "sc-changes-loaded.inner-false-string-error:cleanup", "observation": { - "sender": ["63bc0796d81c", "393d2f9f3485"], - "payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"], + "sender": ["3088889ce80e", "393d2f9f3485"], + "payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"], "settlements": { "mount": "eb79a9b3682a" }, @@ -1195,8 +1195,8 @@ { "id": "sc-changes-loaded.inner-false-object-error:compare-pending", "observation": { - "sender": ["891438a18444", "1940948b426c"], - "payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"], + "sender": ["b823fdc0d205", "1940948b426c"], + "payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"], "settlements": { "mount": "eb79a9b3682a" }, @@ -1207,8 +1207,8 @@ { "id": "sc-changes-loaded.inner-false-object-error:settled", "observation": { - "sender": ["891438a18444", "1940948b426c"], - "payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"], + "sender": ["b823fdc0d205", "1940948b426c"], + "payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"], "settlements": { "mount": "eb79a9b3682a" }, @@ -1219,8 +1219,8 @@ { "id": "sc-changes-loaded.inner-false-object-error:cleanup", "observation": { - "sender": ["63bc0796d81c", "1940948b426c"], - "payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"], + "sender": ["3088889ce80e", "1940948b426c"], + "payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"], "settlements": { "mount": "eb79a9b3682a" }, @@ -1231,8 +1231,8 @@ { "id": "sc-changes-loaded.outer-refused:compare-pending", "observation": { - "sender": ["891438a18444", "085b756c7623"], - "payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"], + "sender": ["b823fdc0d205", "085b756c7623"], + "payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"], "settlements": { "mount": "eb79a9b3682a" }, @@ -1243,8 +1243,8 @@ { "id": "sc-changes-loaded.outer-refused:settled", "observation": { - "sender": ["891438a18444", "085b756c7623"], - "payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"], + "sender": ["b823fdc0d205", "085b756c7623"], + "payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"], "settlements": { "mount": "eb79a9b3682a" }, @@ -1255,8 +1255,8 @@ { "id": "sc-changes-loaded.outer-refused:cleanup", "observation": { - "sender": ["63bc0796d81c", "085b756c7623"], - "payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"], + "sender": ["3088889ce80e", "085b756c7623"], + "payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"], "settlements": { "mount": "eb79a9b3682a" }, @@ -1267,8 +1267,8 @@ { "id": "sc-changes-loaded.outer-refused-no-message:compare-pending", "observation": { - "sender": ["891438a18444", "207e0351be0d"], - "payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"], + "sender": ["b823fdc0d205", "207e0351be0d"], + "payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"], "settlements": { "mount": "eb79a9b3682a" }, @@ -1279,8 +1279,8 @@ { "id": "sc-changes-loaded.outer-refused-no-message:settled", "observation": { - "sender": ["891438a18444", "207e0351be0d"], - "payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"], + "sender": ["b823fdc0d205", "207e0351be0d"], + "payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"], "settlements": { "mount": "eb79a9b3682a" }, @@ -1291,8 +1291,8 @@ { "id": "sc-changes-loaded.outer-refused-no-message:cleanup", "observation": { - "sender": ["63bc0796d81c", "207e0351be0d"], - "payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"], + "sender": ["3088889ce80e", "207e0351be0d"], + "payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"], "settlements": { "mount": "eb79a9b3682a" }, @@ -1303,8 +1303,8 @@ { "id": "sc-changes-loaded.method-not-found:compare-pending", "observation": { - "sender": ["891438a18444", "6d2d788a9e84"], - "payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"], + "sender": ["b823fdc0d205", "6d2d788a9e84"], + "payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"], "settlements": { "mount": "eb79a9b3682a" }, @@ -1315,8 +1315,8 @@ { "id": "sc-changes-loaded.method-not-found:settled", "observation": { - "sender": ["891438a18444", "6d2d788a9e84"], - "payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"], + "sender": ["b823fdc0d205", "6d2d788a9e84"], + "payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"], "settlements": { "mount": "eb79a9b3682a" }, @@ -1327,8 +1327,8 @@ { "id": "sc-changes-loaded.method-not-found:cleanup", "observation": { - "sender": ["63bc0796d81c", "6d2d788a9e84"], - "payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"], + "sender": ["3088889ce80e", "6d2d788a9e84"], + "payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"], "settlements": { "mount": "eb79a9b3682a" }, @@ -1339,8 +1339,8 @@ { "id": "sc-changes-loaded.transport-rejection:compare-pending", "observation": { - "sender": ["891438a18444", "9778e6b1ca17", "f0896523e780"], - "payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc", "5ab051d969ce"], + "sender": ["b823fdc0d205", "9778e6b1ca17", "f0896523e780"], + "payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "5ab051d969ce"], "settlements": { "mount": "eb79a9b3682a" }, @@ -1351,8 +1351,8 @@ { "id": "sc-changes-loaded.transport-rejection:settled", "observation": { - "sender": ["891438a18444", "9778e6b1ca17", "f0896523e780"], - "payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc", "5ab051d969ce"], + "sender": ["b823fdc0d205", "9778e6b1ca17", "f0896523e780"], + "payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "5ab051d969ce"], "settlements": { "mount": "eb79a9b3682a" }, @@ -1363,8 +1363,8 @@ { "id": "sc-changes-loaded.transport-rejection:cleanup", "observation": { - "sender": ["63bc0796d81c", "9778e6b1ca17", "270fa28bd742"], - "payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc", "5ab051d969ce"], + "sender": ["3088889ce80e", "9778e6b1ca17", "270fa28bd742"], + "payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "5ab051d969ce"], "settlements": { "mount": "eb79a9b3682a" }, @@ -1375,8 +1375,8 @@ { "id": "sc-changes-loaded.transport-rejection-no-message:compare-pending", "observation": { - "sender": ["891438a18444", "953d7e425499", "f0896523e780"], - "payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc", "5ab051d969ce"], + "sender": ["b823fdc0d205", "953d7e425499", "f0896523e780"], + "payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "5ab051d969ce"], "settlements": { "mount": "eb79a9b3682a" }, @@ -1387,8 +1387,8 @@ { "id": "sc-changes-loaded.transport-rejection-no-message:settled", "observation": { - "sender": ["891438a18444", "953d7e425499", "f0896523e780"], - "payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc", "5ab051d969ce"], + "sender": ["b823fdc0d205", "953d7e425499", "f0896523e780"], + "payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "5ab051d969ce"], "settlements": { "mount": "eb79a9b3682a" }, @@ -1399,8 +1399,8 @@ { "id": "sc-changes-loaded.transport-rejection-no-message:cleanup", "observation": { - "sender": ["63bc0796d81c", "953d7e425499", "270fa28bd742"], - "payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc", "5ab051d969ce"], + "sender": ["3088889ce80e", "953d7e425499", "270fa28bd742"], + "payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "5ab051d969ce"], "settlements": { "mount": "eb79a9b3682a" }, diff --git a/mobile/rpc-foundation/goldens/matrix-git.changes-load-repo.list-1.json b/mobile/rpc-foundation/goldens/matrix-git.changes-load-repo.list-1.json index 9c9744e247e..8253a6d33a4 100644 --- a/mobile/rpc-foundation/goldens/matrix-git.changes-load-repo.list-1.json +++ b/mobile/rpc-foundation/goldens/matrix-git.changes-load-repo.list-1.json @@ -147,6 +147,38 @@ } } }, + "3088889ce80e": { + "name": "settings.get#1", + "ordinal": 2, + "args": [ + { + "name": "method", + "value": "settings.get" + }, + { + "name": "params", + "value": { + "$rpc": "undefined" + } + }, + { + "name": "options", + "value": { + "failWhenDisconnected": true + } + } + ], + "settlement": { + "status": "rejected", + "startedAt": 0, + "settledAt": 0, + "error": { + "category": "Error", + "message": "Connection closed", + "isRpcDeliveryUnknown": true + } + } + }, "3dcba72c2342": { "name": "streams-registered-at-teardown", "ordinal": 10, @@ -245,38 +277,6 @@ "ordinal": 11, "json": "{\"id\":\"frame-6\",\"deviceToken\":\"recording-device\",\"method\":\"git.branchCompare\",\"params\":{\"worktree\":\"id:repo42::/p\",\"baseRef\":\"origin/dev\"}}" }, - "63bc0796d81c": { - "name": "settings.get#1", - "ordinal": 1, - "args": [ - { - "name": "method", - "value": "settings.get" - }, - { - "name": "params", - "value": { - "$rpc": "undefined" - } - }, - { - "name": "options", - "value": { - "failWhenDisconnected": true - } - } - ], - "settlement": { - "status": "rejected", - "startedAt": 0, - "settledAt": 0, - "error": { - "category": "Error", - "message": "Connection closed", - "isRpcDeliveryUnknown": true - } - } - }, "687fc7be7b14": { "name": "repo.list#1", "ordinal": 7, @@ -530,32 +530,6 @@ } } }, - "891438a18444": { - "name": "settings.get#1", - "ordinal": 1, - "args": [ - { - "name": "method", - "value": "settings.get" - }, - { - "name": "params", - "value": { - "$rpc": "undefined" - } - }, - { - "name": "options", - "value": { - "failWhenDisconnected": true - } - } - ], - "settlement": { - "status": "pending", - "startedAt": 0 - } - }, "8fda864c66d6": { "branchCompareState": { "kind": "loading" @@ -691,6 +665,32 @@ } } }, + "b823fdc0d205": { + "name": "settings.get#1", + "ordinal": 2, + "args": [ + { + "name": "method", + "value": "settings.get" + }, + { + "name": "params", + "value": { + "$rpc": "undefined" + } + }, + { + "name": "options", + "value": { + "failWhenDisconnected": true + } + } + ], + "settlement": { + "status": "pending", + "startedAt": 0 + } + }, "c2c26da9df33": { "name": "repo.list#1", "ordinal": 7, @@ -763,11 +763,6 @@ } } }, - "e539e80d06e9": { - "name": "runtime.clientEvents.subscribe#1", - "ordinal": 2, - "json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"runtime.clientEvents.subscribe\",\"params\":null}" - }, "e610fd221300": { "name": "repo.list#1", "ordinal": 7, @@ -808,6 +803,11 @@ "$rpc": "undefined" } }, + "eef1ee3c2773": { + "name": "runtime.clientEvents.subscribe#1", + "ordinal": 1, + "json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"runtime.clientEvents.subscribe\",\"params\":null}" + }, "f19d3d43b828": { "name": "repo.list#1", "ordinal": 7, @@ -882,8 +882,8 @@ { "id": "sc-changes-loaded.prelude:status-pending", "observation": { - "sender": ["891438a18444", "2ab4c978da8d"], - "payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"], + "sender": ["b823fdc0d205", "2ab4c978da8d"], + "payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"], "settlements": { "mount": "eb79a9b3682a" }, @@ -894,9 +894,9 @@ { "id": "sc-changes-loaded.prelude:compare-pending", "observation": { - "sender": ["891438a18444", "962f91336a50", "6f4a5d6a5a86", "1934c215114a"], + "sender": ["b823fdc0d205", "962f91336a50", "6f4a5d6a5a86", "1934c215114a"], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -913,14 +913,14 @@ "id": "sc-changes-loaded.prelude:cleanup", "observation": { "sender": [ - "63bc0796d81c", + "3088889ce80e", "962f91336a50", "74d102469d68", "f802165696e4", "b60e016a0f1e" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -937,14 +937,14 @@ "id": "sc-changes-loaded.normal:settled", "observation": { "sender": [ - "891438a18444", + "b823fdc0d205", "962f91336a50", "74d102469d68", "2ca33da4d135", "5d30d477f0d5" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -962,14 +962,14 @@ "id": "sc-changes-loaded.normal:cleanup", "observation": { "sender": [ - "63bc0796d81c", + "3088889ce80e", "962f91336a50", "74d102469d68", "2ca33da4d135", "5d30d477f0d5" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -987,14 +987,14 @@ "id": "sc-changes-loaded.result-absent:settled", "observation": { "sender": [ - "891438a18444", + "b823fdc0d205", "962f91336a50", "74d102469d68", "4b1217ea83ab", "5d30d477f0d5" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1012,14 +1012,14 @@ "id": "sc-changes-loaded.result-absent:cleanup", "observation": { "sender": [ - "63bc0796d81c", + "3088889ce80e", "962f91336a50", "74d102469d68", "4b1217ea83ab", "5d30d477f0d5" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1037,14 +1037,14 @@ "id": "sc-changes-loaded.result-null:settled", "observation": { "sender": [ - "891438a18444", + "b823fdc0d205", "962f91336a50", "74d102469d68", "772f9a3bbdd8", "5d30d477f0d5" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1062,14 +1062,14 @@ "id": "sc-changes-loaded.result-null:cleanup", "observation": { "sender": [ - "63bc0796d81c", + "3088889ce80e", "962f91336a50", "74d102469d68", "772f9a3bbdd8", "5d30d477f0d5" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1087,14 +1087,14 @@ "id": "sc-changes-loaded.inner-ok-missing:settled", "observation": { "sender": [ - "891438a18444", + "b823fdc0d205", "962f91336a50", "74d102469d68", "7eb62de26957", "5d30d477f0d5" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1112,14 +1112,14 @@ "id": "sc-changes-loaded.inner-ok-missing:cleanup", "observation": { "sender": [ - "63bc0796d81c", + "3088889ce80e", "962f91336a50", "74d102469d68", "7eb62de26957", "5d30d477f0d5" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1137,14 +1137,14 @@ "id": "sc-changes-loaded.inner-false-string-error:settled", "observation": { "sender": [ - "891438a18444", + "b823fdc0d205", "962f91336a50", "74d102469d68", "d7b92d364b7b", "5d30d477f0d5" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1162,14 +1162,14 @@ "id": "sc-changes-loaded.inner-false-string-error:cleanup", "observation": { "sender": [ - "63bc0796d81c", + "3088889ce80e", "962f91336a50", "74d102469d68", "d7b92d364b7b", "5d30d477f0d5" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1187,14 +1187,14 @@ "id": "sc-changes-loaded.inner-false-object-error:settled", "observation": { "sender": [ - "891438a18444", + "b823fdc0d205", "962f91336a50", "74d102469d68", "6fe24defc416", "5d30d477f0d5" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1212,14 +1212,14 @@ "id": "sc-changes-loaded.inner-false-object-error:cleanup", "observation": { "sender": [ - "63bc0796d81c", + "3088889ce80e", "962f91336a50", "74d102469d68", "6fe24defc416", "5d30d477f0d5" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1237,14 +1237,14 @@ "id": "sc-changes-loaded.outer-refused:settled", "observation": { "sender": [ - "891438a18444", + "b823fdc0d205", "962f91336a50", "74d102469d68", "f19d3d43b828", "5d30d477f0d5" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1262,14 +1262,14 @@ "id": "sc-changes-loaded.outer-refused:cleanup", "observation": { "sender": [ - "63bc0796d81c", + "3088889ce80e", "962f91336a50", "74d102469d68", "f19d3d43b828", "5d30d477f0d5" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1287,14 +1287,14 @@ "id": "sc-changes-loaded.outer-refused-no-message:settled", "observation": { "sender": [ - "891438a18444", + "b823fdc0d205", "962f91336a50", "74d102469d68", "687fc7be7b14", "5d30d477f0d5" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1312,14 +1312,14 @@ "id": "sc-changes-loaded.outer-refused-no-message:cleanup", "observation": { "sender": [ - "63bc0796d81c", + "3088889ce80e", "962f91336a50", "74d102469d68", "687fc7be7b14", "5d30d477f0d5" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1337,14 +1337,14 @@ "id": "sc-changes-loaded.method-not-found:settled", "observation": { "sender": [ - "891438a18444", + "b823fdc0d205", "962f91336a50", "74d102469d68", "75e5bfff5576", "5d30d477f0d5" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1362,14 +1362,14 @@ "id": "sc-changes-loaded.method-not-found:cleanup", "observation": { "sender": [ - "63bc0796d81c", + "3088889ce80e", "962f91336a50", "74d102469d68", "75e5bfff5576", "5d30d477f0d5" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1387,14 +1387,14 @@ "id": "sc-changes-loaded.transport-rejection:settled", "observation": { "sender": [ - "891438a18444", + "b823fdc0d205", "962f91336a50", "74d102469d68", "e610fd221300", "5d30d477f0d5" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1412,14 +1412,14 @@ "id": "sc-changes-loaded.transport-rejection:cleanup", "observation": { "sender": [ - "63bc0796d81c", + "3088889ce80e", "962f91336a50", "74d102469d68", "e610fd221300", "5d30d477f0d5" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1437,14 +1437,14 @@ "id": "sc-changes-loaded.transport-rejection-no-message:settled", "observation": { "sender": [ - "891438a18444", + "b823fdc0d205", "962f91336a50", "74d102469d68", "c2c26da9df33", "5d30d477f0d5" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1462,14 +1462,14 @@ "id": "sc-changes-loaded.transport-rejection-no-message:cleanup", "observation": { "sender": [ - "63bc0796d81c", + "3088889ce80e", "962f91336a50", "74d102469d68", "c2c26da9df33", "5d30d477f0d5" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", diff --git a/mobile/rpc-foundation/goldens/matrix-git.changes-load-worktree.show-1.json b/mobile/rpc-foundation/goldens/matrix-git.changes-load-worktree.show-1.json index cebb910d6e1..13bd3cef82b 100644 --- a/mobile/rpc-foundation/goldens/matrix-git.changes-load-worktree.show-1.json +++ b/mobile/rpc-foundation/goldens/matrix-git.changes-load-worktree.show-1.json @@ -248,6 +248,38 @@ } } }, + "3088889ce80e": { + "name": "settings.get#1", + "ordinal": 2, + "args": [ + { + "name": "method", + "value": "settings.get" + }, + { + "name": "params", + "value": { + "$rpc": "undefined" + } + }, + { + "name": "options", + "value": { + "failWhenDisconnected": true + } + } + ], + "settlement": { + "status": "rejected", + "startedAt": 0, + "settledAt": 0, + "error": { + "category": "Error", + "message": "Connection closed", + "isRpcDeliveryUnknown": true + } + } + }, "3403b59cf439": { "name": "worktree.show#1", "ordinal": 6, @@ -450,38 +482,6 @@ "ordinal": 11, "json": "{\"id\":\"frame-6\",\"deviceToken\":\"recording-device\",\"method\":\"git.branchCompare\",\"params\":{\"worktree\":\"id:repo42::/p\",\"baseRef\":\"origin/dev\"}}" }, - "63bc0796d81c": { - "name": "settings.get#1", - "ordinal": 1, - "args": [ - { - "name": "method", - "value": "settings.get" - }, - { - "name": "params", - "value": { - "$rpc": "undefined" - } - }, - { - "name": "options", - "value": { - "failWhenDisconnected": true - } - } - ], - "settlement": { - "status": "rejected", - "startedAt": 0, - "settledAt": 0, - "error": { - "category": "Error", - "message": "Connection closed", - "isRpcDeliveryUnknown": true - } - } - }, "6f4a5d6a5a86": { "name": "worktree.show#1", "ordinal": 6, @@ -560,32 +560,6 @@ } ] }, - "891438a18444": { - "name": "settings.get#1", - "ordinal": 1, - "args": [ - { - "name": "method", - "value": "settings.get" - }, - { - "name": "params", - "value": { - "$rpc": "undefined" - } - }, - { - "name": "options", - "value": { - "failWhenDisconnected": true - } - } - ], - "settlement": { - "status": "pending", - "startedAt": 0 - } - }, "8989d6980fc9": { "name": "repo.baseRefDefault#1", "ordinal": 10, @@ -782,6 +756,32 @@ } } }, + "b823fdc0d205": { + "name": "settings.get#1", + "ordinal": 2, + "args": [ + { + "name": "method", + "value": "settings.get" + }, + { + "name": "params", + "value": { + "$rpc": "undefined" + } + }, + { + "name": "options", + "value": { + "failWhenDisconnected": true + } + } + ], + "settlement": { + "status": "pending", + "startedAt": 0 + } + }, "cb462f8b50a3": { "name": "worktree.show#1", "ordinal": 8, @@ -924,11 +924,6 @@ } } }, - "e539e80d06e9": { - "name": "runtime.clientEvents.subscribe#1", - "ordinal": 2, - "json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"runtime.clientEvents.subscribe\",\"params\":null}" - }, "eb79a9b3682a": { "status": "fulfilled", "startedAt": 0, @@ -937,6 +932,11 @@ "$rpc": "undefined" } }, + "eef1ee3c2773": { + "name": "runtime.clientEvents.subscribe#1", + "ordinal": 1, + "json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"runtime.clientEvents.subscribe\",\"params\":null}" + }, "f802165696e4": { "name": "repo.list#1", "ordinal": 7, @@ -976,8 +976,8 @@ { "id": "sc-changes-loaded.prelude:status-pending", "observation": { - "sender": ["891438a18444", "2ab4c978da8d"], - "payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"], + "sender": ["b823fdc0d205", "2ab4c978da8d"], + "payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"], "settlements": { "mount": "eb79a9b3682a" }, @@ -988,9 +988,9 @@ { "id": "sc-changes-loaded.prelude:compare-pending", "observation": { - "sender": ["891438a18444", "962f91336a50", "6f4a5d6a5a86", "1934c215114a"], + "sender": ["b823fdc0d205", "962f91336a50", "6f4a5d6a5a86", "1934c215114a"], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1007,14 +1007,14 @@ "id": "sc-changes-loaded.prelude:cleanup", "observation": { "sender": [ - "63bc0796d81c", + "3088889ce80e", "962f91336a50", "da80647539b5", "f802165696e4", "99df70fb15d8" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1031,14 +1031,14 @@ "id": "sc-changes-loaded.normal:settled", "observation": { "sender": [ - "891438a18444", + "b823fdc0d205", "962f91336a50", "74d102469d68", "2ca33da4d135", "5d30d477f0d5" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1056,14 +1056,14 @@ "id": "sc-changes-loaded.normal:cleanup", "observation": { "sender": [ - "63bc0796d81c", + "3088889ce80e", "962f91336a50", "74d102469d68", "2ca33da4d135", "5d30d477f0d5" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1081,14 +1081,14 @@ "id": "sc-changes-loaded.result-absent:settled", "observation": { "sender": [ - "891438a18444", + "b823fdc0d205", "962f91336a50", "b1f1cf609f1a", "2ca33da4d135", "8989d6980fc9" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1106,14 +1106,14 @@ "id": "sc-changes-loaded.result-absent:cleanup", "observation": { "sender": [ - "63bc0796d81c", + "3088889ce80e", "962f91336a50", "b1f1cf609f1a", "2ca33da4d135", "3718b7e83a50" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1131,14 +1131,14 @@ "id": "sc-changes-loaded.result-null:settled", "observation": { "sender": [ - "891438a18444", + "b823fdc0d205", "962f91336a50", "3fa278bfc300", "2ca33da4d135", "8989d6980fc9" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1156,14 +1156,14 @@ "id": "sc-changes-loaded.result-null:cleanup", "observation": { "sender": [ - "63bc0796d81c", + "3088889ce80e", "962f91336a50", "3fa278bfc300", "2ca33da4d135", "3718b7e83a50" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1181,14 +1181,14 @@ "id": "sc-changes-loaded.inner-ok-missing:settled", "observation": { "sender": [ - "891438a18444", + "b823fdc0d205", "962f91336a50", "12cda398ef1c", "2ca33da4d135", "8989d6980fc9" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1206,14 +1206,14 @@ "id": "sc-changes-loaded.inner-ok-missing:cleanup", "observation": { "sender": [ - "63bc0796d81c", + "3088889ce80e", "962f91336a50", "12cda398ef1c", "2ca33da4d135", "3718b7e83a50" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1231,14 +1231,14 @@ "id": "sc-changes-loaded.inner-false-string-error:settled", "observation": { "sender": [ - "891438a18444", + "b823fdc0d205", "962f91336a50", "cbba4d974cd2", "2ca33da4d135", "8989d6980fc9" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1256,14 +1256,14 @@ "id": "sc-changes-loaded.inner-false-string-error:cleanup", "observation": { "sender": [ - "63bc0796d81c", + "3088889ce80e", "962f91336a50", "cbba4d974cd2", "2ca33da4d135", "3718b7e83a50" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1281,14 +1281,14 @@ "id": "sc-changes-loaded.inner-false-object-error:settled", "observation": { "sender": [ - "891438a18444", + "b823fdc0d205", "962f91336a50", "3403b59cf439", "2ca33da4d135", "8989d6980fc9" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1306,14 +1306,14 @@ "id": "sc-changes-loaded.inner-false-object-error:cleanup", "observation": { "sender": [ - "63bc0796d81c", + "3088889ce80e", "962f91336a50", "3403b59cf439", "2ca33da4d135", "3718b7e83a50" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1331,14 +1331,14 @@ "id": "sc-changes-loaded.outer-refused:settled", "observation": { "sender": [ - "891438a18444", + "b823fdc0d205", "962f91336a50", "db7a4d8e637e", "2ca33da4d135", "8989d6980fc9" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1356,14 +1356,14 @@ "id": "sc-changes-loaded.outer-refused:cleanup", "observation": { "sender": [ - "63bc0796d81c", + "3088889ce80e", "962f91336a50", "db7a4d8e637e", "2ca33da4d135", "3718b7e83a50" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1381,14 +1381,14 @@ "id": "sc-changes-loaded.outer-refused-no-message:settled", "observation": { "sender": [ - "891438a18444", + "b823fdc0d205", "962f91336a50", "1266df2a91af", "2ca33da4d135", "8989d6980fc9" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1406,14 +1406,14 @@ "id": "sc-changes-loaded.outer-refused-no-message:cleanup", "observation": { "sender": [ - "63bc0796d81c", + "3088889ce80e", "962f91336a50", "1266df2a91af", "2ca33da4d135", "3718b7e83a50" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1431,14 +1431,14 @@ "id": "sc-changes-loaded.method-not-found:settled", "observation": { "sender": [ - "891438a18444", + "b823fdc0d205", "962f91336a50", "d67ff8e687bf", "2ca33da4d135", "8989d6980fc9" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1456,14 +1456,14 @@ "id": "sc-changes-loaded.method-not-found:cleanup", "observation": { "sender": [ - "63bc0796d81c", + "3088889ce80e", "962f91336a50", "d67ff8e687bf", "2ca33da4d135", "3718b7e83a50" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1481,14 +1481,14 @@ "id": "sc-changes-loaded.transport-rejection:settled", "observation": { "sender": [ - "891438a18444", + "b823fdc0d205", "962f91336a50", "5782be802edd", "2ca33da4d135", "8989d6980fc9" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1506,14 +1506,14 @@ "id": "sc-changes-loaded.transport-rejection:cleanup", "observation": { "sender": [ - "63bc0796d81c", + "3088889ce80e", "962f91336a50", "5782be802edd", "2ca33da4d135", "3718b7e83a50" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1531,14 +1531,14 @@ "id": "sc-changes-loaded.transport-rejection-no-message:settled", "observation": { "sender": [ - "891438a18444", + "b823fdc0d205", "962f91336a50", "1ff055d43072", "2ca33da4d135", "8989d6980fc9" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -1556,14 +1556,14 @@ "id": "sc-changes-loaded.transport-rejection-no-message:cleanup", "observation": { "sender": [ - "63bc0796d81c", + "3088889ce80e", "962f91336a50", "1ff055d43072", "2ca33da4d135", "3718b7e83a50" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", diff --git a/mobile/rpc-foundation/goldens/sc-changes-loaded.json b/mobile/rpc-foundation/goldens/sc-changes-loaded.json index a170eba82de..ed045bdb30b 100644 --- a/mobile/rpc-foundation/goldens/sc-changes-loaded.json +++ b/mobile/rpc-foundation/goldens/sc-changes-loaded.json @@ -147,6 +147,38 @@ } } }, + "3088889ce80e": { + "name": "settings.get#1", + "ordinal": 2, + "args": [ + { + "name": "method", + "value": "settings.get" + }, + { + "name": "params", + "value": { + "$rpc": "undefined" + } + }, + { + "name": "options", + "value": { + "failWhenDisconnected": true + } + } + ], + "settlement": { + "status": "rejected", + "startedAt": 0, + "settledAt": 0, + "error": { + "category": "Error", + "message": "Connection closed", + "isRpcDeliveryUnknown": true + } + } + }, "5d30d477f0d5": { "name": "git.branchCompare#1", "ordinal": 10, @@ -203,38 +235,6 @@ "ordinal": 11, "json": "{\"id\":\"frame-6\",\"deviceToken\":\"recording-device\",\"method\":\"git.branchCompare\",\"params\":{\"worktree\":\"id:repo42::/p\",\"baseRef\":\"origin/dev\"}}" }, - "63bc0796d81c": { - "name": "settings.get#1", - "ordinal": 1, - "args": [ - { - "name": "method", - "value": "settings.get" - }, - { - "name": "params", - "value": { - "$rpc": "undefined" - } - }, - { - "name": "options", - "value": { - "failWhenDisconnected": true - } - } - ], - "settlement": { - "status": "rejected", - "startedAt": 0, - "settledAt": 0, - "error": { - "category": "Error", - "message": "Connection closed", - "isRpcDeliveryUnknown": true - } - } - }, "6f4a5d6a5a86": { "name": "worktree.show#1", "ordinal": 6, @@ -313,32 +313,6 @@ } ] }, - "891438a18444": { - "name": "settings.get#1", - "ordinal": 1, - "args": [ - { - "name": "method", - "value": "settings.get" - }, - { - "name": "params", - "value": { - "$rpc": "undefined" - } - }, - { - "name": "options", - "value": { - "failWhenDisconnected": true - } - } - ], - "settlement": { - "status": "pending", - "startedAt": 0 - } - }, "8fda864c66d6": { "branchCompareState": { "kind": "loading" @@ -441,16 +415,37 @@ "kind": "loading" } }, + "b823fdc0d205": { + "name": "settings.get#1", + "ordinal": 2, + "args": [ + { + "name": "method", + "value": "settings.get" + }, + { + "name": "params", + "value": { + "$rpc": "undefined" + } + }, + { + "name": "options", + "value": { + "failWhenDisconnected": true + } + } + ], + "settlement": { + "status": "pending", + "startedAt": 0 + } + }, "cb462f8b50a3": { "name": "worktree.show#1", "ordinal": 8, "json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"worktree.show\",\"params\":{\"worktree\":\"id:repo42::/p\"}}" }, - "e539e80d06e9": { - "name": "runtime.clientEvents.subscribe#1", - "ordinal": 2, - "json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"runtime.clientEvents.subscribe\",\"params\":null}" - }, "eb79a9b3682a": { "status": "fulfilled", "startedAt": 0, @@ -458,6 +453,11 @@ "value": { "$rpc": "undefined" } + }, + "eef1ee3c2773": { + "name": "runtime.clientEvents.subscribe#1", + "ordinal": 1, + "json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"runtime.clientEvents.subscribe\",\"params\":null}" } }, "recording": { @@ -466,8 +466,8 @@ { "id": "status-pending", "observation": { - "sender": ["891438a18444", "2ab4c978da8d"], - "payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"], + "sender": ["b823fdc0d205", "2ab4c978da8d"], + "payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"], "settlements": { "mount": "eb79a9b3682a" }, @@ -478,9 +478,9 @@ { "id": "compare-pending", "observation": { - "sender": ["891438a18444", "962f91336a50", "6f4a5d6a5a86", "1934c215114a"], + "sender": ["b823fdc0d205", "962f91336a50", "6f4a5d6a5a86", "1934c215114a"], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -497,14 +497,14 @@ "id": "settled", "observation": { "sender": [ - "891438a18444", + "b823fdc0d205", "962f91336a50", "74d102469d68", "2ca33da4d135", "5d30d477f0d5" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -522,14 +522,14 @@ "id": "cleanup", "observation": { "sender": [ - "63bc0796d81c", + "3088889ce80e", "962f91336a50", "74d102469d68", "2ca33da4d135", "5d30d477f0d5" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", diff --git a/mobile/rpc-foundation/goldens/sc-changes-return-from-memory.json b/mobile/rpc-foundation/goldens/sc-changes-return-from-memory.json index fb6db7f022d..3e3e22cf70a 100644 --- a/mobile/rpc-foundation/goldens/sc-changes-return-from-memory.json +++ b/mobile/rpc-foundation/goldens/sc-changes-return-from-memory.json @@ -127,6 +127,38 @@ "$rpc": "undefined" } }, + "22bf66c852bb": { + "name": "settings.get#1", + "ordinal": 2, + "args": [ + { + "name": "method", + "value": "settings.get" + }, + { + "name": "params", + "value": { + "$rpc": "undefined" + } + }, + { + "name": "options", + "value": { + "failWhenDisconnected": true + } + } + ], + "settlement": { + "status": "rejected", + "startedAt": 0, + "settledAt": 3001, + "error": { + "category": "Error", + "message": "Connection closed", + "isRpcDeliveryUnknown": true + } + } + }, "2ca33da4d135": { "name": "repo.list#1", "ordinal": 7, @@ -411,32 +443,6 @@ "ordinal": 17, "json": "{\"id\":\"frame-9\",\"deviceToken\":\"recording-device\",\"method\":\"worktree.show\",\"params\":{\"worktree\":\"id:repo42::/p\"}}" }, - "891438a18444": { - "name": "settings.get#1", - "ordinal": 1, - "args": [ - { - "name": "method", - "value": "settings.get" - }, - { - "name": "params", - "value": { - "$rpc": "undefined" - } - }, - { - "name": "options", - "value": { - "failWhenDisconnected": true - } - } - ], - "settlement": { - "status": "pending", - "startedAt": 0 - } - }, "92a577a15fcc": { "name": "git.status#1", "ordinal": 5, @@ -540,9 +546,9 @@ } ] }, - "ade0dae5eee8": { + "b823fdc0d205": { "name": "settings.get#1", - "ordinal": 1, + "ordinal": 2, "args": [ { "name": "method", @@ -562,14 +568,8 @@ } ], "settlement": { - "status": "rejected", - "startedAt": 0, - "settledAt": 3001, - "error": { - "category": "Error", - "message": "Connection closed", - "isRpcDeliveryUnknown": true - } + "status": "pending", + "startedAt": 0 } }, "cb462f8b50a3": { @@ -646,11 +646,6 @@ } } }, - "e539e80d06e9": { - "name": "runtime.clientEvents.subscribe#1", - "ordinal": 2, - "json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"runtime.clientEvents.subscribe\",\"params\":null}" - }, "eb79a9b3682a": { "status": "fulfilled", "startedAt": 0, @@ -658,6 +653,11 @@ "value": { "$rpc": "undefined" } + }, + "eef1ee3c2773": { + "name": "runtime.clientEvents.subscribe#1", + "ordinal": 1, + "json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"runtime.clientEvents.subscribe\",\"params\":null}" } }, "recording": { @@ -667,14 +667,14 @@ "id": "loaded", "observation": { "sender": [ - "891438a18444", + "b823fdc0d205", "962f91336a50", "74d102469d68", "2ca33da4d135", "5d30d477f0d5" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -692,7 +692,7 @@ "id": "rows-while-revalidating", "observation": { "sender": [ - "891438a18444", + "b823fdc0d205", "962f91336a50", "74d102469d68", "2ca33da4d135", @@ -700,7 +700,7 @@ "7d368b32d250" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -722,7 +722,7 @@ "id": "revalidated", "observation": { "sender": [ - "891438a18444", + "b823fdc0d205", "962f91336a50", "74d102469d68", "2ca33da4d135", @@ -732,7 +732,7 @@ "a6d51875b1b0" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -756,7 +756,7 @@ "id": "cleanup", "observation": { "sender": [ - "ade0dae5eee8", + "22bf66c852bb", "962f91336a50", "74d102469d68", "2ca33da4d135", @@ -767,7 +767,7 @@ "d29ae612a0e8" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", diff --git a/mobile/rpc-foundation/goldens/sc-changes-write-reads-live.json b/mobile/rpc-foundation/goldens/sc-changes-write-reads-live.json index adb6c27e5c8..712bfcbf5d9 100644 --- a/mobile/rpc-foundation/goldens/sc-changes-write-reads-live.json +++ b/mobile/rpc-foundation/goldens/sc-changes-write-reads-live.json @@ -203,6 +203,38 @@ } } }, + "22bf66c852bb": { + "name": "settings.get#1", + "ordinal": 2, + "args": [ + { + "name": "method", + "value": "settings.get" + }, + { + "name": "params", + "value": { + "$rpc": "undefined" + } + }, + { + "name": "options", + "value": { + "failWhenDisconnected": true + } + } + ], + "settlement": { + "status": "rejected", + "startedAt": 0, + "settledAt": 3001, + "error": { + "category": "Error", + "message": "Connection closed", + "isRpcDeliveryUnknown": true + } + } + }, "334b41f87c41": { "name": "worktree.show#1", "ordinal": 6, @@ -380,32 +412,6 @@ "ordinal": 17, "json": "{\"id\":\"frame-9\",\"deviceToken\":\"recording-device\",\"method\":\"worktree.show\",\"params\":{\"worktree\":\"id:repo42::/p\"}}" }, - "891438a18444": { - "name": "settings.get#1", - "ordinal": 1, - "args": [ - { - "name": "method", - "value": "settings.get" - }, - { - "name": "params", - "value": { - "$rpc": "undefined" - } - }, - { - "name": "options", - "value": { - "failWhenDisconnected": true - } - } - ], - "settlement": { - "status": "pending", - "startedAt": 0 - } - }, "92a577a15fcc": { "name": "git.status#1", "ordinal": 5, @@ -562,9 +568,14 @@ "startedAt": 3001 } }, - "ade0dae5eee8": { + "b06ca46466ca": { + "name": "git.status#3", + "ordinal": 14, + "json": "{\"id\":\"frame-8\",\"deviceToken\":\"recording-device\",\"method\":\"git.status\",\"params\":{\"worktree\":\"id:repo42::/p\"}}" + }, + "b823fdc0d205": { "name": "settings.get#1", - "ordinal": 1, + "ordinal": 2, "args": [ { "name": "method", @@ -584,21 +595,10 @@ } ], "settlement": { - "status": "rejected", - "startedAt": 0, - "settledAt": 3001, - "error": { - "category": "Error", - "message": "Connection closed", - "isRpcDeliveryUnknown": true - } + "status": "pending", + "startedAt": 0 } }, - "b06ca46466ca": { - "name": "git.status#3", - "ordinal": 14, - "json": "{\"id\":\"frame-8\",\"deviceToken\":\"recording-device\",\"method\":\"git.status\",\"params\":{\"worktree\":\"id:repo42::/p\"}}" - }, "bf019629baab": { "name": "repo.list#1", "ordinal": 7, @@ -673,11 +673,6 @@ } } }, - "e539e80d06e9": { - "name": "runtime.clientEvents.subscribe#1", - "ordinal": 2, - "json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"runtime.clientEvents.subscribe\",\"params\":null}" - }, "eb79a9b3682a": { "status": "fulfilled", "startedAt": 0, @@ -686,6 +681,11 @@ "$rpc": "undefined" } }, + "eef1ee3c2773": { + "name": "runtime.clientEvents.subscribe#1", + "ordinal": 1, + "json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"runtime.clientEvents.subscribe\",\"params\":null}" + }, "f0a6f14b92e4": { "name": "source-control.status-load-success", "ordinal": 20, @@ -699,7 +699,7 @@ "id": "post-write-status", "observation": { "sender": [ - "891438a18444", + "b823fdc0d205", "962f91336a50", "6f4a5d6a5a86", "1934c215114a", @@ -709,7 +709,7 @@ "a6d51875b1b0" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -734,7 +734,7 @@ "id": "superseded-revalidation-ignored", "observation": { "sender": [ - "891438a18444", + "b823fdc0d205", "962f91336a50", "6f4a5d6a5a86", "1934c215114a", @@ -744,7 +744,7 @@ "a6d51875b1b0" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", @@ -769,7 +769,7 @@ "id": "cleanup", "observation": { "sender": [ - "ade0dae5eee8", + "22bf66c852bb", "962f91336a50", "334b41f87c41", "bf019629baab", @@ -781,7 +781,7 @@ "1a6e003b2d53" ], "payloads": [ - "e539e80d06e9", + "eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "cb462f8b50a3", diff --git a/mobile/src/query/host-event-router.test.ts b/mobile/src/query/host-event-router.test.ts new file mode 100644 index 00000000000..e79d112c587 --- /dev/null +++ b/mobile/src/query/host-event-router.test.ts @@ -0,0 +1,166 @@ +import { createElement } from 'react' +import { focusManager, QueryClientProvider, type QueryClient } from '@tanstack/react-query' +import { act, create, type ReactTestRenderer } from 'react-test-renderer' +import { afterEach, expect, it, vi } from 'vitest' +import { settleQueryNotifications } from '../test-support/rpc-recording/hook-mount' +import { stubRpcClient } from '../transport/rpc/rpc-client-test-stub' +import type { RpcResponse } from '../transport/rpc/rpc-wire-types' +import { useHostEventRouter, useHostEventStreamReady } from './host-event-router' +import { defineHostQuery, useHostQuery } from './host-query' +import { hostQueryKey } from './host-query-key' +import { createOrcaQueryClient } from './orca-query-client' +import { settingsSignal } from './settings-change-signal' + +const NO_INPUT = {} + +const rowsQuery = defineHostQuery({ + family: 'test.rows', + fetch: async (client, _target, _input: typeof NO_INPUT) => { + const reply = await client.sendRequest('test.rows') + return reply.ok ? String(reply.result) : 'refused' + }, + signal: { events: ['worktreesChanged'] } +}) + +let renderer: ReactTestRenderer | null = null + +afterEach(() => { + act(() => renderer?.unmount()) + renderer = null + focusManager.setFocused(undefined) + vi.useRealTimers() +}) + +function desktop() { + let emit: (event: unknown) => void = () => {} + const replies: ((rows: string) => void)[] = [] + const stateListeners = new Set<(state: 'connected' | 'disconnected') => void>() + const client = stubRpcClient({ + getLastConnectedAt: () => 1, + onStateChange: (listener) => { + stateListeners.add(listener) + return () => stateListeners.delete(listener) + }, + subscribe: (_method, _params, onData) => { + emit = onData + return () => {} + }, + sendRequest: () => + new Promise((resolve) => { + replies.push((rows) => resolve({ id: 'r', ok: true, result: rows })) + }) + }) + return { + client, + emit: (event: unknown) => emit(event), + replies, + setState: (state: 'connected' | 'disconnected') => stateListeners.forEach((l) => l(state)) + } +} + +// Holds its answer while the event stream is live, as a settings family on a host with settingsChanged does. +const groupOrderQuery = defineHostQuery({ + family: 'test.settings', + fetch: rowsQuery.fetch, + staleTime: 0, + signal: settingsSignal(['sourceControlGroupOrder']) +}) +const groupOrderKey = hostQueryKey('host-1', groupOrderQuery.family, { exec: 'local' }, NO_INPUT) + +async function mountList( + host: ReturnType, + options: { query?: typeof rowsQuery; queryClient?: QueryClient } = {} +): Promise<() => string | undefined> { + let rows: string | undefined + function List(): null { + useHostEventRouter('host-1', host.client) + const live = useHostEventStreamReady('host-1', host.client) + rows = useHostQuery( + options.query ?? rowsQuery, + { hostId: 'host-1', client: host.client }, + { exec: 'local' }, + NO_INPUT, + { staleTime: options.query === groupOrderQuery && live ? Infinity : undefined } + ).data + return null + } + const queryClient = options.queryClient ?? createOrcaQueryClient() + await act(async () => { + renderer = create( + createElement(QueryClientProvider, { client: queryClient }, createElement(List)) + ) + }) + await settleQueryNotifications() + return () => rows +} + +it('re-reads a settings family only for a settingsChanged naming a setting it reads', async () => { + const host = desktop() + await mountList(host, { query: groupOrderQuery }) + await act(async () => host.replies[0]('changes-first')) + host.emit({ type: 'ready', subscriptionId: 'events-1' }) + + host.emit({ type: 'settingsChanged', keys: ['terminalFontSize'] }) + await settleQueryNotifications() + expect(host.replies).toHaveLength(1) + + host.emit({ type: 'settingsChanged', keys: ['terminalFontSize', 'sourceControlGroupOrder'] }) + await settleQueryNotifications() + expect(host.replies).toHaveLength(2) +}) + +it('reads a settings family again on its next mount, since no stream heard the host meanwhile', async () => { + const host = desktop() + const queryClient = createOrcaQueryClient() + await mountList(host, { query: groupOrderQuery, queryClient }) + await act(async () => host.replies[0]('changes-first')) + host.emit({ type: 'ready', subscriptionId: 'events-1' }) + await act(async () => renderer?.unmount()) + + await mountList(host, { query: groupOrderQuery, queryClient }) + expect(host.replies).toHaveLength(2) +}) + +it('keeps a settings answer stale when the change arrives during a read the page is not watching', async () => { + const host = desktop() + const queryClient = createOrcaQueryClient() + await mountList(host, { query: groupOrderQuery, queryClient }) + await act(async () => host.replies[0]('changes-first')) + host.emit({ type: 'ready', subscriptionId: 'events-1' }) + focusManager.setFocused(false) + void queryClient.refetchQueries({ queryKey: groupOrderKey }) + await settleQueryNotifications() + + host.emit({ type: 'settingsChanged', keys: ['sourceControlGroupOrder'] }) + // This answer was read before the change. + await act(async () => host.replies[1]('changes-first')) + await settleQueryNotifications() + expect(queryClient.getQueryState(groupOrderKey)?.isInvalidated).toBe(true) +}) + +it('reads a settings answer cached before the router started, once its stream is live', async () => { + const host = desktop() + const queryClient = createOrcaQueryClient() + await mountList(host, { query: groupOrderQuery, queryClient }) + await act(async () => host.replies[0]('changes-first')) + host.emit({ type: 'ready', subscriptionId: 'events-1' }) + await act(async () => renderer?.unmount()) + + // Another screen starts the router later; its stream goes live before Changes opens. + vi.useFakeTimers({ toFake: ['Date'] }) + vi.setSystemTime(Date.now() + 60_000) + function Holder(): null { + useHostEventRouter('host-1', host.client) + return null + } + let holder: ReactTestRenderer | null = null + await act(async () => { + holder = create( + createElement(QueryClientProvider, { client: queryClient }, createElement(Holder)) + ) + }) + host.emit({ type: 'ready', subscriptionId: 'events-2' }) + await mountList(host, { query: groupOrderQuery, queryClient }) + expect(host.replies).toHaveLength(2) + act(() => holder?.unmount()) +}) diff --git a/mobile/src/query/host-event-router.ts b/mobile/src/query/host-event-router.ts index 183abafd797..f26fb5f360a 100644 --- a/mobile/src/query/host-event-router.ts +++ b/mobile/src/query/host-event-router.ts @@ -1,4 +1,4 @@ -import { useEffect } from 'react' +import { useCallback, useEffect, useSyncExternalStore } from 'react' import { focusManager, useQueryClient, type Query, type QueryClient } from '@tanstack/react-query' import type { RpcClient } from '../transport/rpc/rpc-client-contract' import { @@ -18,23 +18,48 @@ function targetOf(query: Query): HostQueryKey[3] { return (query.queryKey as HostQueryKey)[3] } -const trailingReads = new WeakMap>() +// What to do once a read already out settles: read again, or only mark the answer stale. +type AfterRead = 'refetch' | 'stale' -function trailingReadsOf(queryClient: QueryClient): Set { - const existing = trailingReads.get(queryClient) +const afterReads = new WeakMap>() + +function afterReadsOf(queryClient: QueryClient): Map { + const existing = afterReads.get(queryClient) if (existing) { return existing } - const hashes = new Set() - trailingReads.set(queryClient, hashes) + const pending = new Map() + afterReads.set(queryClient, pending) // One cache listener per world, for as long as the world's client lives. queryClient.getQueryCache().subscribe(({ type, query }) => { - if (type === 'updated' && hashes.has(query.queryHash) && query.state.fetchStatus === 'idle') { - hashes.delete(query.queryHash) - refetchHostQueryAfterInFlight(queryClient, query) + const after = pending.get(query.queryHash) + if (type === 'updated' && after && query.state.fetchStatus === 'idle') { + pending.delete(query.queryHash) + if (after === 'refetch') { + refetchHostQueryAfterInFlight(queryClient, query) + } else { + void markStale(queryClient, query) + } } }) - return hashes + return pending +} + +function markStale(queryClient: QueryClient, query: Query): Promise { + return queryClient.invalidateQueries({ + queryKey: query.queryKey, + exact: true, + refetchType: 'none' + }) +} + +// A read already out may predate the change, and its answer would clear the mark; mark again once it lands. +function markStaleAfterInFlight(queryClient: QueryClient, query: Query): void { + void markStale(queryClient, query) + const pending = afterReadsOf(queryClient) + if (query.state.fetchStatus === 'fetching' && !pending.has(query.queryHash)) { + pending.set(query.queryHash, 'stale') + } } /** @@ -43,7 +68,7 @@ function trailingReadsOf(queryClient: QueryClient): Set { */ export function refetchHostQueryAfterInFlight(queryClient: QueryClient, query: Query): void { if (query.state.fetchStatus === 'fetching') { - trailingReadsOf(queryClient).add(query.queryHash) + afterReadsOf(queryClient).set(query.queryHash, 'refetch') return } void queryClient.refetchQueries( @@ -52,12 +77,28 @@ export function refetchHostQueryAfterInFlight(queryClient: QueryClient, query: Q ) } +type RouterHandle = { + stop: () => void + isReady: () => boolean + onReadyChange: (listener: () => void) => () => void +} + function startHostEventRouter( queryClient: QueryClient, hostId: string, client: RpcClient -): () => void { - // When the stream last said it was live; a replayed ready may have missed events since. +): RouterHandle { + const startedAt = Date.now() + // Whether the stream is live now, i.e. a change on the host would reach this router. + let ready = false + const readyListeners = new Set<() => void>() + const setReady = (next: boolean): void => { + if (next !== ready) { + ready = next + readyListeners.forEach((listener) => listener()) + } + } + // When the stream last said it was live (0: never); a replayed ready may have missed events since. let readyAt = 0 const floorTimers = new Map>() const signalledQueries = (matches: (signal: HostQuerySignal, query: Query) => boolean): Query[] => @@ -68,13 +109,11 @@ function startHostEventRouter( return signal !== undefined && matches(signal, query) } }) - const markStale = (query: Query): Promise => - queryClient.invalidateQueries({ queryKey: query.queryKey, exact: true, refetchType: 'none' }) // Unobserved or hidden: stale only, so the next mount or foreground reads it. const readsNow = (query: Query): boolean => query.isActive() && focusManager.isFocused() const onChange = (query: Query): void => { - void markStale(query) + markStaleAfterInFlight(queryClient, query) if (!readsNow(query) || floorTimers.has(query.queryHash)) { return } @@ -97,10 +136,8 @@ function startHostEventRouter( ) } - const onReplayedReady = (missedSince: number): void => { - // After a reconnect, the connected edge already re-read every observed query; a replay with no reconnect (a path switch) did not. - const connectedAt = client.getLastConnectedAt() ?? 0 - const readSince = connectedAt > missedSince ? connectedAt : Infinity + // Reads again (or marks stale, when no one watches) every answer older than `readSince`. + const catchUp = (readSince: number): void => { for (const query of signalledQueries(() => true)) { if (query.state.fetchStatus === 'fetching' || query.state.dataUpdatedAt >= readSince) { continue @@ -108,22 +145,33 @@ function startHostEventRouter( if (readsNow(query)) { void queryClient.invalidateQueries({ queryKey: query.queryKey, exact: true }) } else { - void markStale(query) + void markStale(queryClient, query) } } } + const onReplayedReady = (missedSince: number): void => { + // After a reconnect, the connected edge already re-read every observed query; a replay with no reconnect (a path switch) did not. + const connectedAt = client.getLastConnectedAt() ?? 0 + catchUp(connectedAt > missedSince ? connectedAt : Infinity) + } + const onEvent = (event: SharedClientEvent): void => { if (event.type === 'ready') { // Events are not queued while disconnected or between a stream's end and its reopen. if ('replayed' in event) { onReplayedReady(readyAt) + } else if (readyAt === 0) { + // Answers cached before this router started were read while nothing heard the host. + catchUp(startedAt) } readyAt = Date.now() + setReady(true) return } if (event.type === 'end' || event.type === 'error') { // The shared stream opens again by itself; its next ready re-reads what was missed. + setReady(false) return } const signalled: HostSignalEvent = event @@ -136,16 +184,24 @@ function startHostEventRouter( } const stopStream = subscribeSharedClientEvents(client, onEvent) - return () => { - stopStream() - for (const timer of floorTimers.values()) { - clearTimeout(timer) + return { + stop: () => { + stopStream() + for (const timer of floorTimers.values()) { + clearTimeout(timer) + } + floorTimers.clear() + readyListeners.clear() + }, + isReady: () => ready, + onReadyChange: (listener) => { + readyListeners.add(listener) + return () => readyListeners.delete(listener) } - floorTimers.clear() } } -type Router = { holders: number; stop: () => void } +type Router = { holders: number; handle: RouterHandle } const routers = new WeakMap>() @@ -154,7 +210,7 @@ function retainHostEventRouter( queryClient: QueryClient, hostId: string, client: RpcClient -): () => void { +): { handle: RouterHandle; release: () => void } { let byClient = routers.get(queryClient) if (!byClient) { byClient = new Map() @@ -163,25 +219,55 @@ function retainHostEventRouter( const clients = byClient let router = clients.get(client) if (!router) { - router = { holders: 0, stop: startHostEventRouter(queryClient, hostId, client) } + router = { holders: 0, handle: startHostEventRouter(queryClient, hostId, client) } clients.set(client, router) } const held = router held.holders += 1 - return () => { + const release = (): void => { held.holders -= 1 if (held.holders === 0) { - held.stop() + held.handle.stop() clients.delete(client) } } + return { handle: held.handle, release } } /** Keeps the host's event-signalled families (see HostQuery `signal`) fresh while a screen reads them. */ export function useHostEventRouter(hostId: string | undefined, client: RpcClient | null): void { const queryClient = useQueryClient() useEffect( - () => (client && hostId ? retainHostEventRouter(queryClient, hostId, client) : undefined), + () => + client && hostId ? retainHostEventRouter(queryClient, hostId, client).release : undefined, [queryClient, hostId, client] ) } + +/** + * Keeps the host's event router running, like useHostEventRouter, and says whether its event stream + * is live. Only while it is can a family hold its answer until an event marks it stale. + */ +export function useHostEventStreamReady( + hostId: string | undefined, + client: RpcClient | null +): boolean { + const queryClient = useQueryClient() + const subscribe = useCallback( + (onChange: () => void) => { + if (!client || !hostId) { + return () => {} + } + const { handle, release } = retainHostEventRouter(queryClient, hostId, client) + const stopListening = handle.onReadyChange(onChange) + return () => { + stopListening() + release() + } + }, + [queryClient, hostId, client] + ) + return useSyncExternalStore(subscribe, () => + client && hostId ? (routers.get(queryClient)?.get(client)?.handle.isReady() ?? false) : false + ) +} diff --git a/mobile/src/query/host-query.ts b/mobile/src/query/host-query.ts index 8eedacead2d..4d65785430e 100644 --- a/mobile/src/query/host-query.ts +++ b/mobile/src/query/host-query.ts @@ -34,7 +34,7 @@ export type HostQuery = { fetch?: HostQueryFetch staleTime?: StaleTimeFunction gcTime?: number - // Only for families the desktop sends no change signal for. + // Reads a stale answer on foreground: one with no change signal, or one an event marked while hidden. refetchOnWindowFocus?: boolean // For a screen that offers its own Retry, so a lost read is reported instead of sent again. retry?: false @@ -177,7 +177,13 @@ export function useHostQuery( host: { hostId: string; client: RpcClient | null }, target: HostQueryTarget, input: TInput, - options?: { enabled?: boolean; subscribed?: boolean; refetchInterval?: number | false } + options?: { + enabled?: boolean + subscribed?: boolean + refetchInterval?: number | false + // Replaces the family's own, e.g. once the host is known to signal every change. + staleTime?: number + } ): UseQueryResult { const { hostId, client } = host const enabled = client !== null && options?.enabled !== false @@ -194,6 +200,7 @@ export function useHostQuery( }, [query, client, hostId, keyHash, enabled]) return useQuery({ ...queryOptions, + ...(options?.staleTime === undefined ? {} : { staleTime: options.staleTime }), subscribed: options?.subscribed, refetchInterval: options?.refetchInterval }) diff --git a/mobile/src/query/settings-change-signal.ts b/mobile/src/query/settings-change-signal.ts new file mode 100644 index 00000000000..e99fc42c077 --- /dev/null +++ b/mobile/src/query/settings-change-signal.ts @@ -0,0 +1,35 @@ +import { SETTINGS_CHANGED_EVENT_RUNTIME_CAPABILITY } from '../../../src/shared/protocol-version' +import { useOptionalHostProtocolGates } from '../components/host-protocol-gates-context' +import type { RpcClient } from '../transport/rpc/rpc-client-contract' +import { useRouteRelaysCapability } from '../worktree/workspace-server-context' +import { useHostEventStreamReady } from './host-event-router' +import type { HostQuerySignal } from './host-query' + +/** + * Whether a settings family can hold its answer until a settingsChanged event marks it stale: the + * route's host publishes the event and this page's event stream from it is live. Otherwise (older + * hosts, a stream that ended, screens outside a host route) the family keeps its own rereads. + */ +export function useHostSettingsChangeSignal(hostId: string, client: RpcClient | null): boolean { + const hostCapabilities = useOptionalHostProtocolGates()?.hostCapabilities + const relayed = useRouteRelaysCapability(SETTINGS_CHANGED_EVENT_RUNTIME_CAPABILITY) + const published = + hostCapabilities?.includes(SETTINGS_CHANGED_EVENT_RUNTIME_CAPABILITY) === true && relayed + const streamReady = useHostEventStreamReady( + published ? hostId : undefined, + published ? client : null + ) + return published && streamReady +} + +/** The signal of a family that reads only `keys` of the host's settings. */ +export function settingsSignal(keys: readonly string[]): HostQuerySignal { + return { + events: ['settingsChanged'], + // An event without a key list (malformed) could name anything. + matches: (event) => + event.type !== 'settingsChanged' || + !Array.isArray(event.keys) || + event.keys.some((key) => keys.includes(key)) + } +} diff --git a/mobile/src/session/agent-launch/mobile-agent-launch-queries.ts b/mobile/src/session/agent-launch/mobile-agent-launch-queries.ts index ae3c10c09cf..a4e86c7ec93 100644 --- a/mobile/src/session/agent-launch/mobile-agent-launch-queries.ts +++ b/mobile/src/session/agent-launch/mobile-agent-launch-queries.ts @@ -9,6 +9,7 @@ import { type HostQueryTarget } from '../../query/host-query-key' import { hostReadClient } from '../../query/host-read-client' +import { useHostSettingsChangeSignal } from '../../query/settings-change-signal' import type { RpcClient } from '../../transport/rpc/rpc-client-contract' import { newTabSettingsRead } from './mobile-new-tab-settings-operations' import { @@ -75,16 +76,18 @@ export async function refreshDetectedAgents( const NO_INPUT = {} +// The launch reads the whole settings object, so any settingsChanged makes it stale. const newTabSettingsQuery = defineHostQuery({ family: 'settings.newTab', staleTime: 60_000, gcTime: 30 * 60_000, + signal: { events: ['settingsChanged'] }, fetch: async (client, _target, _input: typeof NO_INPUT) => ({ settings: newTabSettingsRead.interpret(await newTabSettingsRead.request(client))() }) }) -// Settings are read again on every sheet open; the cached ones paint meanwhile. +// A host without settingsChanged gets a reread on every sheet open; the cached ones paint meanwhile. export function reloadNewTabSettings( queryClient: QueryClient, hostId: string, @@ -101,6 +104,8 @@ type MobileAgentLaunchQueries = { settings: UseQueryResult<{ settings: unknown }> target: HostQueryTarget input: DetectionInput + // The host tells this page when settings change, so a sheet open need not read them again. + settingsSignalled: boolean } // One agent list per workspace and document, shared by the "+" sheet and the "Fix with" labels. @@ -130,11 +135,13 @@ export function useMobileAgentLaunchQueries(args: { enabled, subscribed: observed(detectedAgentsQuery.family, target, input) }) + const settingsSignalled = useHostSettingsChangeSignal(hostId, client) const settings = useHostQuery(newTabSettingsQuery, { hostId, client }, settingsTarget, NO_INPUT, { enabled, - subscribed: observed(newTabSettingsQuery.family, settingsTarget, NO_INPUT) + subscribed: observed(newTabSettingsQuery.family, settingsTarget, NO_INPUT), + staleTime: settingsSignalled ? Infinity : undefined }) - return { detection, settings, target, input } + return { detection, settings, target, input, settingsSignalled } } export function agentLaunchContextOf({ diff --git a/mobile/src/session/agent-launch/use-mobile-new-tab-agent-options.ts b/mobile/src/session/agent-launch/use-mobile-new-tab-agent-options.ts index 24fb782b3ec..20636bce0fa 100644 --- a/mobile/src/session/agent-launch/use-mobile-new-tab-agent-options.ts +++ b/mobile/src/session/agent-launch/use-mobile-new-tab-agent-options.ts @@ -43,7 +43,7 @@ export function useMobileNewTabAgentOptions(args: { const { client, connState, hostId, open } = args const queryClient = useQueryClient() const connected = client !== null && connState === 'connected' - const { detection, settings, target, input } = useMobileAgentLaunchQueries({ + const { detection, settings, target, input, settingsSignalled } = useMobileAgentLaunchQueries({ hostId, client, worktreeId: args.worktreeId, @@ -58,7 +58,9 @@ export function useMobileNewTabAgentOptions(args: { if (!open || !client || connState !== 'connected') { return } - reloadNewTabSettings(queryClient, hostId, target.exec) + if (!settingsSignalled) { + reloadNewTabSettings(queryClient, hostId, target.exec) + } const queryKey = hostQueryKey(hostId, detectedAgentsQuery.family, target, input) const cached = queryClient.getQueryState(queryKey) const refreshed = refreshedThisConnection(client) @@ -92,7 +94,7 @@ export function useMobileNewTabAgentOptions(args: { refreshed.delete(targetKey) } }) - }, [client, connState, hostId, input, mountedAt, open, queryClient, target]) + }, [client, connState, hostId, input, mountedAt, open, queryClient, settingsSignalled, target]) const detected = detection.data const loadState: MobileNewTabAgentLoadState = !connected diff --git a/mobile/src/source-control/mobile-source-control-settings-operations.ts b/mobile/src/source-control/mobile-source-control-settings-operations.ts index 1a4f2afa3ce..7bd2839f597 100644 --- a/mobile/src/source-control/mobile-source-control-settings-operations.ts +++ b/mobile/src/source-control/mobile-source-control-settings-operations.ts @@ -10,6 +10,14 @@ export type MobileSourceControlSettings = { diffShowWhitespace: boolean } +const SOURCE_CONTROL_SETTING = { + groupOrder: 'sourceControlGroupOrder', + compareAgainstUpstream: 'sourceControlCompareAgainstUpstream', + diffShowWhitespace: 'diffShowWhitespace' +} as const + +export const SOURCE_CONTROL_SETTINGS_KEYS: readonly string[] = Object.values(SOURCE_CONTROL_SETTING) + // Older hosts omit these settings; absence reads as desktop's defaults. const sourceControlSettingsReader: RpcCompatibleReader< unknown, @@ -22,9 +30,9 @@ const sourceControlSettingsReader: RpcCompatibleReader< compatible: true, variant: 'source-control-settings', value: { - groupOrder: normalizeSourceControlGroupOrder(field('sourceControlGroupOrder')), - compareAgainstUpstream: field('sourceControlCompareAgainstUpstream') === true, - diffShowWhitespace: field('diffShowWhitespace') === true + groupOrder: normalizeSourceControlGroupOrder(field(SOURCE_CONTROL_SETTING.groupOrder)), + compareAgainstUpstream: field(SOURCE_CONTROL_SETTING.compareAgainstUpstream) === true, + diffShowWhitespace: field(SOURCE_CONTROL_SETTING.diffShowWhitespace) === true }, salvage: { droppedPaths: [], droppedCount: 0 } } diff --git a/mobile/src/source-control/mobile-source-control-settings.ts b/mobile/src/source-control/mobile-source-control-settings.ts index b0bc9b6b326..4355ad1f9eb 100644 --- a/mobile/src/source-control/mobile-source-control-settings.ts +++ b/mobile/src/source-control/mobile-source-control-settings.ts @@ -4,7 +4,9 @@ import { DEFAULT_SOURCE_CONTROL_GROUP_ORDER } from '../../../src/shared/source-c import { useWorkspaceExecutionHost } from '../navigation/workspace-execution-host' import { defineHostQuery, useHostQuery } from '../query/host-query' import { hostQueryKey } from '../query/host-query-key' +import { settingsSignal, useHostSettingsChangeSignal } from '../query/settings-change-signal' import { + SOURCE_CONTROL_SETTINGS_KEYS, sourceControlSettingsRead, type MobileSourceControlSettings } from './mobile-source-control-settings-operations' @@ -19,12 +21,13 @@ const DESKTOP_DEFAULTS: MobileSourceControlSettings = { const NO_INPUT = {} -// The desktop sends no settings change signal, so every mount and foreground rereads behind the cached copy. +// A host without settingsChanged gets a reread on every mount and foreground, behind the cached copy. const sourceControlSettingsQuery = defineHostQuery({ family: 'settings.sourceControl', staleTime: 0, refetchOnWindowFocus: true, gcTime: 30 * 60_000, + signal: settingsSignal(SOURCE_CONTROL_SETTINGS_KEYS), fetch: async ( client, _target, @@ -46,12 +49,13 @@ export function useMobileSourceControlSettings( ): { settings: MobileSourceControlSettings; reload: () => void } { const queryClient = useQueryClient() const exec = useWorkspaceExecutionHost() ?? 'local' + const signalled = useHostSettingsChangeSignal(hostId, client) const { data } = useHostQuery( sourceControlSettingsQuery, { hostId, client }, { exec }, NO_INPUT, - { enabled: connState === 'connected' } + { enabled: connState === 'connected', staleTime: signalled ? Infinity : undefined } ) const reload = useCallback(() => { void queryClient.invalidateQueries({ diff --git a/src/main/runtime/client/settings/runtime-settings-change-events.test.ts b/src/main/runtime/client/settings/runtime-settings-change-events.test.ts new file mode 100644 index 00000000000..ddaee15f4b7 --- /dev/null +++ b/src/main/runtime/client/settings/runtime-settings-change-events.test.ts @@ -0,0 +1,46 @@ +import { describe, expect, it } from 'vitest' +import { getDefaultSettings } from '../../../../shared/constants' +import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { RuntimeClientEvent } from '../../../../shared/runtime-client-events' +import { publishSettingsChanges } from './runtime-settings-change-events' + +type Listener = (updates: Partial, settings: GlobalSettings) => void + +function settingsStore(initial: GlobalSettings) { + let settings = initial + const listeners = new Set() + return { + getSettings: () => settings, + onSettingsChanged: (listener: Listener) => { + listeners.add(listener) + return () => listeners.delete(listener) + }, + // Like the real store: replace the object, then pass listeners what the writer sent. + update: (updates: Partial) => { + settings = { ...settings, ...updates } + for (const listener of listeners) { + listener(updates, settings) + } + } + } +} + +describe('publishSettingsChanges', () => { + it('names only the settings whose values changed', () => { + const store = settingsStore({ + ...getDefaultSettings('/home/me'), + prBotAuthorOverrides: ['renovate'], + diffShowWhitespace: false + }) + const events: RuntimeClientEvent[] = [] + publishSettingsChanges(store, (event) => events.push(event)) + + store.update({ + prBotAuthorOverrides: ['renovate'], + diffShowWhitespace: true + }) + store.update({ diffShowWhitespace: true }) + + expect(events).toEqual([{ type: 'settingsChanged', keys: ['diffShowWhitespace'] }]) + }) +}) diff --git a/src/main/runtime/client/settings/runtime-settings-change-events.ts b/src/main/runtime/client/settings/runtime-settings-change-events.ts new file mode 100644 index 00000000000..37e49ae92f7 --- /dev/null +++ b/src/main/runtime/client/settings/runtime-settings-change-events.ts @@ -0,0 +1,25 @@ +import { isDeepStrictEqual } from 'node:util' +import type { RuntimeClientEvent } from '../../../../shared/runtime-client-events' +import type { RuntimeStore } from '../../construction/runtime-store-contract' + +/** Tells clients which top-level settings changed, so a phone re-reads only what it shows. */ +export function publishSettingsChanges( + store: Pick | null, + emit: (event: RuntimeClientEvent) => void +): void { + if (!store?.getSettings || !store.onSettingsChanged) { + return + } + let previous = new Map(Object.entries(store.getSettings())) + store.onSettingsChanged((updates, settings) => { + const next = new Map(Object.entries(settings)) + // A writer may resend a value it did not change, as an equal but new object. + const keys = Object.keys(updates).filter( + (key) => !isDeepStrictEqual(previous.get(key), next.get(key)) + ) + previous = next + if (keys.length > 0) { + emit({ type: 'settingsChanged', keys }) + } + }) +} diff --git a/src/main/runtime/orca-runtime.ts b/src/main/runtime/orca-runtime.ts index 5c30d7579a0..8c28e659ffb 100644 --- a/src/main/runtime/orca-runtime.ts +++ b/src/main/runtime/orca-runtime.ts @@ -3,6 +3,7 @@ import { conversationRecordReader } from './orchestration/addressing/session-lin import type { RuntimeLinearCommandSurface } from './integrations/linear/runtime-linear-command-surface' import { installRuntimeLinearCommandSurface } from './integrations/linear/runtime-linear-command-surface' import { publishNativeChatPreferenceChanges } from './agent-session/launch/runtime-native-chat-preference-events' +import { publishSettingsChanges } from './client/settings/runtime-settings-change-events' import { publishWorkspaceViewChanges } from './sidebar-inputs/runtime-workspace-view-change-events' import { OrcaRuntimeWithSidebarTemporal, @@ -175,6 +176,7 @@ class OrcaRuntimeService extends OrcaRuntimeSidebarBase { registerWorktreeChangeInvalidator((repoId) => this.invalidateWorktreeCatalog(repoId)) publishWorkspaceViewChanges(this.store, (event) => this.emitClientEvent(event)) publishNativeChatPreferenceChanges(this.store, (event) => this.emitClientEvent(event)) + publishSettingsChanges(this.store, (event) => this.emitClientEvent(event)) } private structuredAgentAvailability?: ReturnType diff --git a/src/shared/host-runtime-capabilities.ts b/src/shared/host-runtime-capabilities.ts index debd2b0d710..2469c5f9952 100644 --- a/src/shared/host-runtime-capabilities.ts +++ b/src/shared/host-runtime-capabilities.ts @@ -13,6 +13,9 @@ export const RUNTIME_AUTOMATIC_WORK_RUNTIME_CAPABILITY = 'runtime.automatic-work // Hosts without this capability ignore a request's expectedRuntimeSource; the CLI's pre-send probe // is then the only fence. export const RUNTIME_SOURCE_FENCE_RUNTIME_CAPABILITY = 'runtime-source-fence.v1' as const +// Hosts with this capability publish settingsChanged, so a client keeps settings until it says otherwise. +export const SETTINGS_CHANGED_EVENT_RUNTIME_CAPABILITY = + 'runtime.settings-changed-event.v1' as const // The paired host itself: status, environments, control, updates and the servers it manages. export const HOST_RUNTIME_CAPABILITIES = [ @@ -24,5 +27,6 @@ export const HOST_RUNTIME_CAPABILITIES = [ MANAGED_RUNTIME_INSTALL_RUNTIME_CAPABILITY, MANAGED_RUNTIME_REMOVE_RUNTIME_CAPABILITY, RUNTIME_SOURCE_FENCE_RUNTIME_CAPABILITY, + SETTINGS_CHANGED_EVENT_RUNTIME_CAPABILITY, SSH_TARGET_MANAGEMENT_RUNTIME_CAPABILITY ] as const diff --git a/src/shared/runtime-client-events.ts b/src/shared/runtime-client-events.ts index 9ff9664b4c8..0c03f46106d 100644 --- a/src/shared/runtime-client-events.ts +++ b/src/shared/runtime-client-events.ts @@ -25,6 +25,8 @@ export type RuntimeClientEvent = | { type: 'workspaceViewChanged' } // Index, HEAD or refs moved in a watched local repo; without `worktreeIds` any of its checkouts may have changed. | { type: 'gitStatusChanged'; repoId: string; worktreeIds?: string[] } + /** Top-level settings whose values changed; a phone re-reads only the settings it shows. */ + | { type: 'settingsChanged'; keys: string[] } | { type: 'worktreesChanged' repoId: string