diff --git a/.github/pr-screenshots/2601/README.md b/.github/pr-screenshots/2601/README.md new file mode 100644 index 0000000000..1ac18db0fd --- /dev/null +++ b/.github/pr-screenshots/2601/README.md @@ -0,0 +1,11 @@ +# #2601 native failure evidence + +Actual iOS Simulator action-row crops, personally inspected by QA owner and source owner. They contain only Sign out/Delete account; private full screenshots are excluded. Cropped, not rescaled. EXIF metadata stripped; image data unchanged. Six matched pairs: l/d = light/dark; 1 = large, 2 = accessibility-large, 3 = accessibility-extra-extra-extra-large; b = Before, a = After #2601 (FAIL). Each pair uses identical crop coordinates. + +Before: `914bfa57ed04807dc3f94a1ed6a4e678da898591` (Batch56). After: `a1656d18a70f1f115da41092ca159b59e8895f4f` (Batch57, merged #2601). English; iOS27 QA Simulator; full viewport 402 × 874. Manifest records exact source, capture time, crop coordinates, original crop and public image SHA256. + +Installed executable SHA256: `55de08577ac5ddb38fb0221427750b8d5096dfe10b55a1561bb438c3bf95807a`. Strict native fingerprint Before `b3e74315f0c2d639dd1c1ff73e56182e0fb86c0e`; After `bf3f308a0826b5b33be4890e4023dbb7e6de4e7b`. QA owner qualified binary reuse: fingerprint difference is expo-router58.0.25 peer-suffix paths; 21 iOS/2 Android files and two config plugins are byte-identical; autolinking differs only in those paths. No rebuild/reinstall. Cold launch and loaded JS check confirmed two tint calls. + +FAIL in all six cases: Sign out text changes from blue to red; both icons remain blue, while Delete text remains red. Sign out appears optically left of the trash glyph. These images are failure evidence, not proof of the successor fix. + +Observed: correct labels, enabled/hittable rows, readable two-line Delete at maximum text, live theme change. Disabled/loading behavior, callbacks/confirmation and VoiceOver DEFERRED: no safe account fixture; Human actions never clicked. AX cells do not independently prove VoiceOver button traits. No account deletion authorized. Native acceptance remains open under #2581. diff --git a/.github/pr-screenshots/2601/a-d1.png b/.github/pr-screenshots/2601/a-d1.png new file mode 100644 index 0000000000..d9df444460 Binary files /dev/null and b/.github/pr-screenshots/2601/a-d1.png differ diff --git a/.github/pr-screenshots/2601/a-d2.png b/.github/pr-screenshots/2601/a-d2.png new file mode 100644 index 0000000000..d6f383765e Binary files /dev/null and b/.github/pr-screenshots/2601/a-d2.png differ diff --git a/.github/pr-screenshots/2601/a-d3.png b/.github/pr-screenshots/2601/a-d3.png new file mode 100644 index 0000000000..9762ac2bbe Binary files /dev/null and b/.github/pr-screenshots/2601/a-d3.png differ diff --git a/.github/pr-screenshots/2601/a-l1.png b/.github/pr-screenshots/2601/a-l1.png new file mode 100644 index 0000000000..59574fcdd8 Binary files /dev/null and b/.github/pr-screenshots/2601/a-l1.png differ diff --git a/.github/pr-screenshots/2601/a-l2.png b/.github/pr-screenshots/2601/a-l2.png new file mode 100644 index 0000000000..6f5b260aeb Binary files /dev/null and b/.github/pr-screenshots/2601/a-l2.png differ diff --git a/.github/pr-screenshots/2601/a-l3.png b/.github/pr-screenshots/2601/a-l3.png new file mode 100644 index 0000000000..441bc58a73 Binary files /dev/null and b/.github/pr-screenshots/2601/a-l3.png differ diff --git a/.github/pr-screenshots/2601/b-d1.png b/.github/pr-screenshots/2601/b-d1.png new file mode 100644 index 0000000000..d674385de7 Binary files /dev/null and b/.github/pr-screenshots/2601/b-d1.png differ diff --git a/.github/pr-screenshots/2601/b-d2.png b/.github/pr-screenshots/2601/b-d2.png new file mode 100644 index 0000000000..b95c2362f3 Binary files /dev/null and b/.github/pr-screenshots/2601/b-d2.png differ diff --git a/.github/pr-screenshots/2601/b-d3.png b/.github/pr-screenshots/2601/b-d3.png new file mode 100644 index 0000000000..b278817fa1 Binary files /dev/null and b/.github/pr-screenshots/2601/b-d3.png differ diff --git a/.github/pr-screenshots/2601/b-l1.png b/.github/pr-screenshots/2601/b-l1.png new file mode 100644 index 0000000000..94ee950c31 Binary files /dev/null and b/.github/pr-screenshots/2601/b-l1.png differ diff --git a/.github/pr-screenshots/2601/b-l2.png b/.github/pr-screenshots/2601/b-l2.png new file mode 100644 index 0000000000..f2f99f507a Binary files /dev/null and b/.github/pr-screenshots/2601/b-l2.png differ diff --git a/.github/pr-screenshots/2601/b-l3.png b/.github/pr-screenshots/2601/b-l3.png new file mode 100644 index 0000000000..3bd2d013aa Binary files /dev/null and b/.github/pr-screenshots/2601/b-l3.png differ diff --git a/.github/pr-screenshots/2601/manifest.json b/.github/pr-screenshots/2601/manifest.json new file mode 100644 index 0000000000..aff68919fa --- /dev/null +++ b/.github/pr-screenshots/2601/manifest.json @@ -0,0 +1,134 @@ +[ + { + "file": "b-l1.png", + "source": "914bfa57ed04807dc3f94a1ed6a4e678da898591", + "theme": "light", + "size": "large", + "crop": [16, 231, 386, 334], + "originalCropSha256": "51e32aba5b022897e4b2258d36e4eded71a0d0ee38d5ca32bead0fb9c087723a", + "sha256": "1d46476171841331e934ebd1f1a74c901568db37b9dd6e12e8053949d4df17b9", + "metadataRemoved": ["eXIf"], + "capturedAt": "2026-10-22T18:08:28.193098+00:00" + }, + { + "file": "b-l2.png", + "source": "914bfa57ed04807dc3f94a1ed6a4e678da898591", + "theme": "light", + "size": "accessibility-large", + "crop": [16, 302, 386, 440], + "originalCropSha256": "377a2439c5f5e6d44f263e7213795015b284303cf9db89c9f7890d334aa1cd7b", + "sha256": "7417cfa1ae8a020e95cb3c1d9f331a28c223a87440b1ddac668940babd5904b6", + "metadataRemoved": ["eXIf"], + "capturedAt": "2026-10-22T18:08:30.354686+00:00" + }, + { + "file": "b-l3.png", + "source": "914bfa57ed04807dc3f94a1ed6a4e678da898591", + "theme": "light", + "size": "accessibility-extra-extra-extra-large", + "crop": [16, 495, 386, 743], + "originalCropSha256": "3ebf163e7cbb6b945a530a2e7d3437404a90b91f3de4264ce8a29b6b849e29c4", + "sha256": "96ed774dd2fe8a408944c6d4d6dc313720eaea5d909e79d1bd64269f1940b634", + "metadataRemoved": ["eXIf"], + "capturedAt": "2026-10-22T18:08:32.438105+00:00" + }, + { + "file": "b-d1.png", + "source": "914bfa57ed04807dc3f94a1ed6a4e678da898591", + "theme": "dark", + "size": "large", + "crop": [16, 231, 386, 334], + "originalCropSha256": "c9dda224cba75a1de549bf022655cbfca0e1afe683ef9688418f8449e0c36797", + "sha256": "9ba96f42541551cd8ae573ec6cbcbda67da4a651edafc49a09ba2ef64b6f52f3", + "metadataRemoved": ["eXIf"], + "capturedAt": "2026-10-22T18:08:34.672985+00:00" + }, + { + "file": "b-d2.png", + "source": "914bfa57ed04807dc3f94a1ed6a4e678da898591", + "theme": "dark", + "size": "accessibility-large", + "crop": [16, 302, 386, 440], + "originalCropSha256": "9ad0acb471a08307083f255426968b186500b4426da6228d675d04ee5fa412de", + "sha256": "9623a58bbab0d6fae56af556dc6de061748586bd0c66b7d6e23f7a07f2b0a025", + "metadataRemoved": ["eXIf"], + "capturedAt": "2026-10-22T18:08:36.725492+00:00" + }, + { + "file": "b-d3.png", + "source": "914bfa57ed04807dc3f94a1ed6a4e678da898591", + "theme": "dark", + "size": "accessibility-extra-extra-extra-large", + "crop": [16, 495, 386, 743], + "originalCropSha256": "f9cd38b599b86113ec56a3b9527142aae028863dea4a6fab942e0442561b210c", + "sha256": "a645e845351f9b81045b0d75fca6d7f77d0fddcd650a6c91341cb0c7e0cefd6b", + "metadataRemoved": ["eXIf"], + "capturedAt": "2026-10-22T18:08:38.762890+00:00" + }, + { + "file": "a-l1.png", + "source": "a1656d18a70f1f115da41092ca159b59e8895f4f", + "theme": "light", + "size": "large", + "crop": [16, 231, 386, 334], + "originalCropSha256": "7deceea5c691afa058171fa01d324b87f79cf31ca9544478586d690a9f824315", + "sha256": "8d714c691b4dc3bcd6afa5ff17803fc2ab4d935b206b041e2a8014d4d97746ee", + "metadataRemoved": ["eXIf"], + "capturedAt": "2026-10-22T18:16:51.957825+00:00" + }, + { + "file": "a-l2.png", + "source": "a1656d18a70f1f115da41092ca159b59e8895f4f", + "theme": "light", + "size": "accessibility-large", + "crop": [16, 302, 386, 440], + "originalCropSha256": "0e84646c9217e5b323d02d574c38dfafb43d8a8cf3778103d3460dba10c9a860", + "sha256": "5d0928f27043431b3a760cb809bfeffe1d3f75d767ade1aca50f1b1df4a3a834", + "metadataRemoved": ["eXIf"], + "capturedAt": "2026-10-22T18:16:54.019830+00:00" + }, + { + "file": "a-l3.png", + "source": "a1656d18a70f1f115da41092ca159b59e8895f4f", + "theme": "light", + "size": "accessibility-extra-extra-extra-large", + "crop": [16, 495, 386, 743], + "originalCropSha256": "223ac14c7d0e0fe390af718f383457e6d7110f2e49b27d0588b8a8d34e822112", + "sha256": "e7b69d2c62c4adbb4f06a25d72ca2f65a5ca1d43db333f8a0e8b2c5a2f082d1b", + "metadataRemoved": ["eXIf"], + "capturedAt": "2026-10-22T18:16:56.175373+00:00" + }, + { + "file": "a-d1.png", + "source": "a1656d18a70f1f115da41092ca159b59e8895f4f", + "theme": "dark", + "size": "large", + "crop": [16, 231, 386, 334], + "originalCropSha256": "4b0a97d041547e25cf83e0f5bafcd73298246f6e631c0c9956bfd964ae348baa", + "sha256": "77c47610525cb2813516a0e596ffe039585297af0c1402bf72398d2e5f00fbb7", + "metadataRemoved": ["eXIf"], + "capturedAt": "2026-10-22T18:16:58.557545+00:00" + }, + { + "file": "a-d2.png", + "source": "a1656d18a70f1f115da41092ca159b59e8895f4f", + "theme": "dark", + "size": "accessibility-large", + "crop": [16, 302, 386, 440], + "originalCropSha256": "4d87c174019437b3a171c731803952eadc903762e9b1728ff4ae429fceb04316", + "sha256": "693c76e6117182ad936ea04289ce28e310810a395f0be2628cb570b9b0e01424", + "metadataRemoved": ["eXIf"], + "capturedAt": "2026-10-22T18:17:00.654675+00:00" + }, + { + "file": "a-d3.png", + "source": "a1656d18a70f1f115da41092ca159b59e8895f4f", + "theme": "dark", + "size": "accessibility-extra-extra-extra-large", + "crop": [16, 495, 386, 743], + "originalCropSha256": "395f470651af88295d51810b15ca6cd00115f284afc804714dec1fb6bb8a5ae7", + "sha256": "b7d296ffdf3b44b9ae8621610e3256a007b5c787a32a555bdbb3b9636519af22", + "metadataRemoved": ["eXIf"], + "capturedAt": "2026-10-22T18:17:02.766729+00:00" + } +] diff --git a/.github/pr-screenshots/2602/README.md b/.github/pr-screenshots/2602/README.md new file mode 100644 index 0000000000..3b444f469f --- /dev/null +++ b/.github/pr-screenshots/2602/README.md @@ -0,0 +1,15 @@ +# #2602 native color and alignment evidence + +Twelve actual iOS Simulator action-only crops, reviewed by QA and source owners. No email, computer list or private full screenshot is included. PNG metadata removed; image data is unchanged. b/a = Before/After; l/d = light/dark; 1/2/3 = large/accessibility-large/accessibility-extra-extra-extra-large. Each pair has identical union-boundary crop coordinates, without resizing. Manifest records source and original/public crop SHA256. + +Before: Batch57 main `a1656d18a70f1f115da41092ca159b59e8895f4f`. After: Batch58 frozen `f95bca7e34852cf616cab1508bfaa07ea2104fb5`. English; iOS27 Simulator; viewport 402 × 874. Strict native fingerprint `bf3f308a0826b5b33be4890e4023dbb7e6de4e7b` identical across both; installed executable SHA256 `55de08577ac5ddb38fb0221427750b8d5096dfe10b55a1561bb438c3bf95807a` unchanged. QA owner verified cold exact dev app and loaded custom AccountAction/direct foreground/optical offset. No rebuild/reinstall. + +PASS, narrow native visual result: both action texts and both symbols red across all six cases; 12/12 icon ROIs have red pixels and zero blue. Correct accessible labels, enabled/hittable rows, no visible overlap/clipping, complete maximum-size Delete wrapping aligned to text start, live theme/size changes observed. + +Optical acceptance remains pending Human review. Former left shift is no longer seen. Sign out color-weighted ink centroid minus trash is +0.44/+0.89/+2.12px in light and +0.41/+0.81/+2.12px in dark, versus Before approximately -1.36/-2.48/-2.86px. This is not a SwiftUI slot measurement or a perceptual threshold. Source review keeps the 1.5pt coefficient: different glyph shapes and a centroid residual alone do not justify retuning a validated source revision. No Human optical PASS is claimed. + +Measurements use the original action crops, not these union-boundary pairs: per-action vertical bounds; x cutoffs Before 48/68/92 and After 50/82/120; red means R>G+30 and R>B+30, blue means B>R+30 and B>G+10. Before center uses blue weighted by B-R; After uses red weighted by R-max(G,B). These isolate symbols from text, including Before's wrapped red second line. Coordinates are crop-relative and comparable between rows within each image. They are not font metrics. + +DEFERRED: disabled/loading/inertness, actual action/confirmation flow and VoiceOver traits. No safe account fixture; Human actions never clicked. AX cell observations do not prove VoiceOver traits. Both-action confirmation and account-bound pairing cleanup are separate functional scope, unchanged by this color PR. + +Draft; independent Human merge authorization required. Evidence publication does not modify product/native inputs. Batch58 RELEASED after owned-resource cleanup, not a product release approval. diff --git a/.github/pr-screenshots/2602/a-d1.png b/.github/pr-screenshots/2602/a-d1.png new file mode 100644 index 0000000000..fcf2f4b038 Binary files /dev/null and b/.github/pr-screenshots/2602/a-d1.png differ diff --git a/.github/pr-screenshots/2602/a-d2.png b/.github/pr-screenshots/2602/a-d2.png new file mode 100644 index 0000000000..01bf6ee560 Binary files /dev/null and b/.github/pr-screenshots/2602/a-d2.png differ diff --git a/.github/pr-screenshots/2602/a-d3.png b/.github/pr-screenshots/2602/a-d3.png new file mode 100644 index 0000000000..1c37ceb294 Binary files /dev/null and b/.github/pr-screenshots/2602/a-d3.png differ diff --git a/.github/pr-screenshots/2602/a-l1.png b/.github/pr-screenshots/2602/a-l1.png new file mode 100644 index 0000000000..89ef5c3041 Binary files /dev/null and b/.github/pr-screenshots/2602/a-l1.png differ diff --git a/.github/pr-screenshots/2602/a-l2.png b/.github/pr-screenshots/2602/a-l2.png new file mode 100644 index 0000000000..4167c8ac52 Binary files /dev/null and b/.github/pr-screenshots/2602/a-l2.png differ diff --git a/.github/pr-screenshots/2602/a-l3.png b/.github/pr-screenshots/2602/a-l3.png new file mode 100644 index 0000000000..cf1ce2194f Binary files /dev/null and b/.github/pr-screenshots/2602/a-l3.png differ diff --git a/.github/pr-screenshots/2602/b-d1.png b/.github/pr-screenshots/2602/b-d1.png new file mode 100644 index 0000000000..d9df444460 Binary files /dev/null and b/.github/pr-screenshots/2602/b-d1.png differ diff --git a/.github/pr-screenshots/2602/b-d2.png b/.github/pr-screenshots/2602/b-d2.png new file mode 100644 index 0000000000..c3d2eeae4a Binary files /dev/null and b/.github/pr-screenshots/2602/b-d2.png differ diff --git a/.github/pr-screenshots/2602/b-d3.png b/.github/pr-screenshots/2602/b-d3.png new file mode 100644 index 0000000000..7cef4c899d Binary files /dev/null and b/.github/pr-screenshots/2602/b-d3.png differ diff --git a/.github/pr-screenshots/2602/b-l1.png b/.github/pr-screenshots/2602/b-l1.png new file mode 100644 index 0000000000..59574fcdd8 Binary files /dev/null and b/.github/pr-screenshots/2602/b-l1.png differ diff --git a/.github/pr-screenshots/2602/b-l2.png b/.github/pr-screenshots/2602/b-l2.png new file mode 100644 index 0000000000..2151f4fb4f Binary files /dev/null and b/.github/pr-screenshots/2602/b-l2.png differ diff --git a/.github/pr-screenshots/2602/b-l3.png b/.github/pr-screenshots/2602/b-l3.png new file mode 100644 index 0000000000..71db75ffd7 Binary files /dev/null and b/.github/pr-screenshots/2602/b-l3.png differ diff --git a/.github/pr-screenshots/2602/manifest.json b/.github/pr-screenshots/2602/manifest.json new file mode 100644 index 0000000000..2049aa33d6 --- /dev/null +++ b/.github/pr-screenshots/2602/manifest.json @@ -0,0 +1,122 @@ +[ + { + "theme": "light", + "size": "large", + "variant": "before", + "sourceSha": "a1656d18a70f1f115da41092ca159b59e8895f4f", + "crop": [16, 231, 386, 334], + "image": "b-l1.png", + "originalCropSha256": "7deceea5c691afa058171fa01d324b87f79cf31ca9544478586d690a9f824315", + "sha256": "8d714c691b4dc3bcd6afa5ff17803fc2ab4d935b206b041e2a8014d4d97746ee" + }, + { + "theme": "light", + "size": "large", + "variant": "after", + "sourceSha": "f95bca7e34852cf616cab1508bfaa07ea2104fb5", + "crop": [16, 231, 386, 334], + "image": "a-l1.png", + "originalCropSha256": "02759b40994d22e03254ad840c60f72de41eb024aa49cf8740374c182dcc54bd", + "sha256": "e481a7c5315a7cf82a39a17913245afbeef7628cf64e1452681444bc6dc92cef" + }, + { + "theme": "light", + "size": "accessibility-large", + "variant": "before", + "sourceSha": "a1656d18a70f1f115da41092ca159b59e8895f4f", + "crop": [16, 302, 386, 444], + "image": "b-l2.png", + "originalCropSha256": "b1080a5d3868717ebf79d969ebb80907c6b677612652935b3cb6d88907d023f0", + "sha256": "7e26aef7d6ce5a2d85e3d7043172967a1e4830b26556184fd74010d0761010cb" + }, + { + "theme": "light", + "size": "accessibility-large", + "variant": "after", + "sourceSha": "f95bca7e34852cf616cab1508bfaa07ea2104fb5", + "crop": [16, 302, 386, 444], + "image": "a-l2.png", + "originalCropSha256": "e12d8cb14c9d1f86d18900748a8a1b300d1da4321c65ddb72ec88a63bfaf8f41", + "sha256": "f12644f6ef71e0ec6e8089d811af1989cf5d313d7c66a366709dbfc93789ce42" + }, + { + "theme": "light", + "size": "accessibility-extra-extra-extra-large", + "variant": "before", + "sourceSha": "a1656d18a70f1f115da41092ca159b59e8895f4f", + "crop": [16, 495, 386, 749], + "image": "b-l3.png", + "originalCropSha256": "4d7a74697902323089d1bf734d5db1fe616df7ddcbd3de6be06418cd40f12730", + "sha256": "3ce718ff371836f92db95991e0e92c09d6ca3652cdea37bfc906eac7cbc5fa11" + }, + { + "theme": "light", + "size": "accessibility-extra-extra-extra-large", + "variant": "after", + "sourceSha": "f95bca7e34852cf616cab1508bfaa07ea2104fb5", + "crop": [16, 495, 386, 749], + "image": "a-l3.png", + "originalCropSha256": "1f0c15af596fc62f8b781fc1ea01a3d1e80183dfb0cbb4309554ae0bf4113c9c", + "sha256": "d38b9977330b6ca036e8789fd7a015863af92b2938991563b2aef778a107daf5" + }, + { + "theme": "dark", + "size": "large", + "variant": "before", + "sourceSha": "a1656d18a70f1f115da41092ca159b59e8895f4f", + "crop": [16, 231, 386, 334], + "image": "b-d1.png", + "originalCropSha256": "4b0a97d041547e25cf83e0f5bafcd73298246f6e631c0c9956bfd964ae348baa", + "sha256": "77c47610525cb2813516a0e596ffe039585297af0c1402bf72398d2e5f00fbb7" + }, + { + "theme": "dark", + "size": "large", + "variant": "after", + "sourceSha": "f95bca7e34852cf616cab1508bfaa07ea2104fb5", + "crop": [16, 231, 386, 334], + "image": "a-d1.png", + "originalCropSha256": "6cd93fefa03e01a81f797861744a844ebfc60bfac2fa4f1a5a6f3af8c6486650", + "sha256": "b2565b23571c2b300ebb4b478e02e316c9208f3141cba577ffe849d7192c5e2b" + }, + { + "theme": "dark", + "size": "accessibility-large", + "variant": "before", + "sourceSha": "a1656d18a70f1f115da41092ca159b59e8895f4f", + "crop": [16, 302, 386, 444], + "image": "b-d2.png", + "originalCropSha256": "a4922d56ccb13b61ba1541a8d4a14736b3c1e8162566b7b9cdb0deb192c6ccc6", + "sha256": "a0d8f1a7f4f3cfd4d7dbe9af8cffee845a727e7ea3e1ed2918993f55b535d0dd" + }, + { + "theme": "dark", + "size": "accessibility-large", + "variant": "after", + "sourceSha": "f95bca7e34852cf616cab1508bfaa07ea2104fb5", + "crop": [16, 302, 386, 444], + "image": "a-d2.png", + "originalCropSha256": "9735d61a9911a27508ae0f95ae424859f228cffd386db8329f8e3475cebe56e2", + "sha256": "27420e5335e0d829f738d3f80fd59a2b0eb888838fe182f66ea3bcff73941b72" + }, + { + "theme": "dark", + "size": "accessibility-extra-extra-extra-large", + "variant": "before", + "sourceSha": "a1656d18a70f1f115da41092ca159b59e8895f4f", + "crop": [16, 495, 386, 749], + "image": "b-d3.png", + "originalCropSha256": "5e75c85def0384779782c46d5b8db884cd67421a8d540e062d520f096f83ea62", + "sha256": "9e6c2ac8d375e4a6a9b2ee938f85188665a3ce4c98e7e1f37d4a69adc39f210e" + }, + { + "theme": "dark", + "size": "accessibility-extra-extra-extra-large", + "variant": "after", + "sourceSha": "f95bca7e34852cf616cab1508bfaa07ea2104fb5", + "crop": [16, 495, 386, 749], + "image": "a-d3.png", + "originalCropSha256": "dcde19b9fecd3111fa6329d621cbad6dd059ebe5a9806de3d25e5bd373d9d0c6", + "sha256": "bbef3c7ab6980f608f6dff5d0854ccbf09016e21c5d6472820fcb67c28bb0968" + } +] diff --git a/.github/pr-screenshots/2602/measurements.json b/.github/pr-screenshots/2602/measurements.json new file mode 100644 index 0000000000..fb7bfb2774 --- /dev/null +++ b/.github/pr-screenshots/2602/measurements.json @@ -0,0 +1,290 @@ +[ + { + "batch": 57, + "theme": "light", + "size": "large", + "icons": [ + { + "label": "Sign out", + "redPixels": 0, + "bluePixels": 181, + "textRedPixels": 342, + "inkBounds": [15, 39], + "weightedInkCenter": 26.12 + }, + { + "label": "Delete account", + "redPixels": 0, + "bluePixels": 229, + "textRedPixels": 602, + "inkBounds": [17, 37], + "weightedInkCenter": 27.483 + } + ], + "signOutMinusTrash": -1.363 + }, + { + "batch": 57, + "theme": "light", + "size": "accessibility-large", + "icons": [ + { + "label": "Sign out", + "redPixels": 0, + "bluePixels": 450, + "textRedPixels": 1040, + "inkBounds": [19, 56], + "weightedInkCenter": 34.988 + }, + { + "label": "Delete account", + "redPixels": 0, + "bluePixels": 490, + "textRedPixels": 1884, + "inkBounds": [22, 53], + "weightedInkCenter": 37.464 + } + ], + "signOutMinusTrash": -2.476 + }, + { + "batch": 57, + "theme": "light", + "size": "accessibility-extra-extra-extra-large", + "icons": [ + { + "label": "Sign out", + "redPixels": 0, + "bluePixels": 693, + "textRedPixels": 2415, + "inkBounds": [26, 73], + "weightedInkCenter": 46.438 + }, + { + "label": "Delete account", + "redPixels": 955, + "bluePixels": 876, + "textRedPixels": 3398, + "inkBounds": [30, 69], + "weightedInkCenter": 49.297 + } + ], + "signOutMinusTrash": -2.859 + }, + { + "batch": 57, + "theme": "dark", + "size": "large", + "icons": [ + { + "label": "Sign out", + "redPixels": 0, + "bluePixels": 181, + "textRedPixels": 317, + "inkBounds": [15, 39], + "weightedInkCenter": 26.115 + }, + { + "label": "Delete account", + "redPixels": 0, + "bluePixels": 225, + "textRedPixels": 600, + "inkBounds": [17, 37], + "weightedInkCenter": 27.479 + } + ], + "signOutMinusTrash": -1.364 + }, + { + "batch": 57, + "theme": "dark", + "size": "accessibility-large", + "icons": [ + { + "label": "Sign out", + "redPixels": 0, + "bluePixels": 432, + "textRedPixels": 978, + "inkBounds": [19, 56], + "weightedInkCenter": 35.02 + }, + { + "label": "Delete account", + "redPixels": 0, + "bluePixels": 485, + "textRedPixels": 1858, + "inkBounds": [22, 53], + "weightedInkCenter": 37.473 + } + ], + "signOutMinusTrash": -2.453 + }, + { + "batch": 57, + "theme": "dark", + "size": "accessibility-extra-extra-extra-large", + "icons": [ + { + "label": "Sign out", + "redPixels": 0, + "bluePixels": 690, + "textRedPixels": 2364, + "inkBounds": [26, 73], + "weightedInkCenter": 46.45 + }, + { + "label": "Delete account", + "redPixels": 944, + "bluePixels": 867, + "textRedPixels": 3385, + "inkBounds": [30, 69], + "weightedInkCenter": 49.312 + } + ], + "signOutMinusTrash": -2.862 + }, + { + "batch": 58, + "theme": "light", + "size": "large", + "icons": [ + { + "label": "Sign out", + "redPixels": 136, + "bluePixels": 0, + "textRedPixels": 340, + "inkBounds": [22, 41], + "weightedInkCenter": 29.984 + }, + { + "label": "Delete account", + "redPixels": 169, + "bluePixels": 0, + "textRedPixels": 587, + "inkBounds": [22, 37], + "weightedInkCenter": 29.546 + } + ], + "signOutMinusTrash": 0.438 + }, + { + "batch": 58, + "theme": "light", + "size": "accessibility-large", + "icons": [ + { + "label": "Sign out", + "redPixels": 426, + "bluePixels": 0, + "textRedPixels": 1035, + "inkBounds": [30, 67], + "weightedInkCenter": 46.348 + }, + { + "label": "Delete account", + "redPixels": 510, + "bluePixels": 0, + "textRedPixels": 1855, + "inkBounds": [30, 61], + "weightedInkCenter": 45.454 + } + ], + "signOutMinusTrash": 0.894 + }, + { + "batch": 58, + "theme": "light", + "size": "accessibility-extra-extra-extra-large", + "icons": [ + { + "label": "Sign out", + "redPixels": 1048, + "bluePixels": 0, + "textRedPixels": 2462, + "inkBounds": [41, 101], + "weightedInkCenter": 67.37 + }, + { + "label": "Delete account", + "redPixels": 1265, + "bluePixels": 0, + "textRedPixels": 4458, + "inkBounds": [40, 90], + "weightedInkCenter": 65.247 + } + ], + "signOutMinusTrash": 2.123 + }, + { + "batch": 58, + "theme": "dark", + "size": "large", + "icons": [ + { + "label": "Sign out", + "redPixels": 130, + "bluePixels": 0, + "textRedPixels": 316, + "inkBounds": [22, 40], + "weightedInkCenter": 29.957 + }, + { + "label": "Delete account", + "redPixels": 157, + "bluePixels": 0, + "textRedPixels": 556, + "inkBounds": [22, 37], + "weightedInkCenter": 29.549 + } + ], + "signOutMinusTrash": 0.408 + }, + { + "batch": 58, + "theme": "dark", + "size": "accessibility-large", + "icons": [ + { + "label": "Sign out", + "redPixels": 401, + "bluePixels": 0, + "textRedPixels": 1004, + "inkBounds": [30, 67], + "weightedInkCenter": 46.262 + }, + { + "label": "Delete account", + "redPixels": 490, + "bluePixels": 0, + "textRedPixels": 1751, + "inkBounds": [30, 61], + "weightedInkCenter": 45.453 + } + ], + "signOutMinusTrash": 0.809 + }, + { + "batch": 58, + "theme": "dark", + "size": "accessibility-extra-extra-extra-large", + "icons": [ + { + "label": "Sign out", + "redPixels": 1016, + "bluePixels": 0, + "textRedPixels": 2398, + "inkBounds": [41, 101], + "weightedInkCenter": 67.376 + }, + { + "label": "Delete account", + "redPixels": 1243, + "bluePixels": 0, + "textRedPixels": 4316, + "inkBounds": [40, 90], + "weightedInkCenter": 65.258 + } + ], + "signOutMinusTrash": 2.118 + } +] diff --git a/apps/mobile/app/qa/account-actions.tsx b/apps/mobile/app/qa/account-actions.tsx new file mode 100644 index 0000000000..dad11f42a5 --- /dev/null +++ b/apps/mobile/app/qa/account-actions.tsx @@ -0,0 +1,62 @@ +import * as Application from 'expo-application'; +import { Redirect, Stack, useLocalSearchParams } from 'expo-router'; +import { useMemo, useState, useSyncExternalStore } from 'react'; +import { ScrollView, View } from 'react-native'; +import { + createAccountActionFixture, + type AccountFixtureScenario, +} from '../../src/host/account-action-fixture'; +import { AccountHosts } from '../../src/ui/account-hosts'; +import { Button } from '../../src/ui/primitives/button'; +import { Text } from '../../src/ui/primitives/text'; +import { space } from '../../src/ui/design/tokens'; +import { t } from '../../src/ui/strings'; + +export default function AccountActionsFixtureRoute() { + if (!__DEV__ || !Application.applicationId?.endsWith('.dev')) return ; + return ; +} + +function AccountActionsFixture() { + const params = useLocalSearchParams<{ scenario?: string }>(); + const scenarios: AccountFixtureScenario[] = [ + 'success', + 'delete-partial', + 'local-write', + 'session-write', + 'expired-retry', + 'completion-write', + ]; + const scenario = scenarios.find((value) => value === params.scenario) ?? 'success'; + const [reset, setReset] = useState(0); + const fixture = useMemo(() => createAccountActionFixture(scenario), [scenario, reset]); + const snapshot = useSyncExternalStore( + fixture.subscribe, + fixture.getSnapshot, + fixture.getSnapshot, + ); + return ( + + + {}} + /> + + {t.accountFixture.notice} + + ); +} diff --git a/apps/mobile/src/ui/primitives/account-panel.tsx b/apps/mobile/src/ui/primitives/account-panel.tsx index 757f7a8679..4df2c1393d 100644 --- a/apps/mobile/src/ui/primitives/account-panel.tsx +++ b/apps/mobile/src/ui/primitives/account-panel.tsx @@ -13,6 +13,7 @@ export interface AccountComputerRow { } export interface AccountPanelProps { email: string | undefined | null | false; + pendingDeletion?: boolean; loading: boolean; busy: boolean; rows: AccountComputerRow[] | undefined; @@ -42,7 +43,7 @@ export function AccountPanel(props: AccountPanelProps) { ) : props.email !== false ? ( <> ) : ( <> - + ), + }; +}); +vi.mock('react-native', () => import('./react-native-shim')); +vi.mock('react-native-reanimated', () => import('./reanimated-shim')); +vi.mock( + '../src/ui/primitives/account-panel', + () => import('../src/ui/primitives/account-panel.ios'), +); +vi.mock('expo-router', () => ({ + useFocusEffect: (focus: () => void | (() => void)) => { + useSyncExternalStore( + useCallback(() => focus() ?? (() => {}), [focus]), + () => true, + ); + }, +})); +const confirmations = vi.hoisted( + () => + [] as Array<{ + title: string; + message: string; + label: string; + confirm(): unknown; + }>, +); +vi.mock('../src/ui/primitives/app-dialog', () => ({ + confirmDestructive: (title: string, message: string, label: string, confirm: () => unknown) => { + confirmations.push({ title, message, label, confirm }); + }, +})); + +import { + createAccountActionFixture, + type AccountFixtureScenario, +} from '../src/host/account-action-fixture'; +import { AccountHosts } from '../src/ui/account-hosts'; +import { t } from '../src/ui/strings'; + +Object.assign(globalThis, { IS_REACT_ACT_ENVIRONMENT: true }); +let root: Root | undefined; +let host: HTMLElement; +afterEach(() => { + act(() => root?.unmount()); + host?.remove(); + root = undefined; + confirmations.length = 0; +}); + +async function render(scenario: AccountFixtureScenario = 'success') { + const fixture = createAccountActionFixture(scenario); + host = document.createElement('div'); + document.body.append(host); + root = createRoot(host); + const update = (busy = false) => + root!.render( + , + ); + await act(async () => update()); + return { fixture, update }; +} +const button = (id: string) => host.querySelector(`[data-testid="${id}"]`)!; +const click = (id: string) => act(async () => button(id).click()); + +it.each(['sign-out', 'delete'] as const)( + 'keeps the iOS %s action inert until confirmation and rejects duplicate submission', + async (action) => { + const { fixture } = await render(); + const before = fixture.getSnapshot(); + await click(`account-${action}`); + expect(fixture.getSnapshot()).toBe(before); + expect(confirmations).toHaveLength(1); + const copy = + action === 'sign-out' + ? [t.pairAccount.signOutTitle, t.pairAccount.signOutMessage] + : [t.pairAccount.deleteTitle, t.pairAccount.deleteMessage]; + expect([confirmations[0]!.title, confirmations[0]!.message]).toEqual(copy); + confirmations.pop(); + expect(fixture.getSnapshot()).toBe(before); + await click(`account-${action}`); + const confirmation = confirmations[0]!; + await act(async () => { + await Promise.all([confirmation.confirm(), confirmation.confirm()]); + }); + expect(JSON.parse(fixture.getSnapshot())).toMatchObject({ + signedIn: false, + saved: ['manual', 'legacy', 'other'], + cleared: ['owned'], + disconnects: 1, + deletes: action === 'delete' ? 1 : 0, + }); + expect(host.querySelector('[data-testid="account-sign-out"]')).toBeNull(); + }, +); + +it.each([ + 'local-write', + 'session-write', + 'delete-partial', + 'expired-retry', + 'completion-write', +] as const)( + 'keeps the styled iOS recovery action consistent with its confirmation after %s', + async (scenario) => { + const { fixture } = await render(scenario); + const original = button('account-sign-out'); + expect(original.textContent).toBe(t.pairAccount.signOut); + const iconForeground = original.querySelector('i')!.getAttribute('data-foreground'); + const textForeground = original.querySelector('span')!.getAttribute('data-foreground'); + expect(iconForeground).toBeTruthy(); + expect(textForeground).toBe(iconForeground); + await click('account-delete'); + expect(button('account-delete').dataset['nativeRole']).toBe('destructive'); + await act(async () => { + await expect(confirmations[0]!.confirm()).rejects.toThrow(); + }); + const recovery = button('account-sign-out'); + expect(recovery.textContent).toBe(t.pairAccount.cleanupConfirm); + expect(recovery.getAttribute('aria-label')).toBe(t.pairAccount.cleanupConfirm); + expect(recovery.querySelector('i')!.dataset['symbol']).toBe( + 'rectangle.portrait.and.arrow.right', + ); + expect(recovery.querySelector('i')!.getAttribute('aria-hidden')).toBe('true'); + expect(recovery.querySelector('i')!.getAttribute('data-foreground')).toBe(iconForeground); + expect(recovery.querySelector('span')!.getAttribute('data-foreground')).toBe(textForeground); + const before = fixture.getSnapshot(); + await click('account-sign-out'); + const recoveryDialog = confirmations.at(-1)!; + expect([recoveryDialog.title, recoveryDialog.message, recoveryDialog.label]).toEqual([ + t.pairAccount.cleanupTitle, + t.pairAccount.cleanupMessage, + t.pairAccount.cleanupConfirm, + ]); + expect(fixture.getSnapshot()).toBe(before); + confirmations.pop(); + await click('account-sign-out'); + await act(async () => { + await confirmations.at(-1)!.confirm(); + }); + expect(JSON.parse(fixture.getSnapshot())).toMatchObject({ + signedIn: false, + saved: ['manual', 'legacy', 'other'], + deletes: 1, + }); + }, +); + +it('disables both actual iOS controls during busy and loading states and rejects a stale confirmation', async () => { + const { fixture, update } = await render(); + await click('account-sign-out'); + const old = confirmations[0]!; + const before = fixture.getSnapshot(); + await act(async () => update(true)); + expect(button('account-sign-out').disabled).toBe(true); + expect(button('account-delete').disabled).toBe(true); + await click('account-delete'); + await act(async () => { + await old.confirm(); + }); + expect(confirmations).toHaveLength(1); + expect(fixture.getSnapshot()).toBe(before); + await act(async () => update(false)); + let release!: () => void; + const held = new Promise((resolve) => { + release = resolve; + }); + const signOut = fixture.account.signOut; + fixture.account.signOut = async (key) => { + await held; + return signOut(key); + }; + let pending: unknown; + await act(async () => { + pending = old.confirm(); + }); + expect(button('account-sign-out').disabled).toBe(true); + expect(button('account-delete').disabled).toBe(true); + await click('account-delete'); + expect(confirmations).toHaveLength(1); + await act(async () => { + release(); + await pending; + }); + expect(JSON.parse(fixture.getSnapshot()).signedIn).toBe(false); +}); diff --git a/apps/mobile/test/connect-account.test.ts b/apps/mobile/test/connect-account.test.ts index efdd2190b7..2e42471f6e 100644 --- a/apps/mobile/test/connect-account.test.ts +++ b/apps/mobile/test/connect-account.test.ts @@ -31,7 +31,7 @@ function fakeRelay( return Response.json({ access_token: 'access-0', refresh_token: 'refresh-0', - user: { email: 'alice@example.com' }, + user: { id: 'user_alice', email: 'alice@example.com' }, }); if (options.expired) return Response.json({ error: 'invalid_grant' }, { status: 400 }); return Response.json({ access_token: 'access-1', refresh_token: 'refresh-1' }); @@ -101,6 +101,8 @@ describe('phone Connect account', () => { clientId: 'client_01TEST', refreshToken: 'refresh-0', email: 'alice@example.com', + subject: 'user_alice', + sessionId: 'random-3', }); expect(await relay.account.hosts()).toEqual({ ok: true, @@ -123,11 +125,11 @@ describe('phone Connect account', () => { offer: '', encryption: { protocol: 'connect-noise-xk-v1', publicKey: 'ab'.repeat(32) }, enrollment: { body: 'signed-request', signature: 'signature' }, - verifier: 'random-3', + verifier: 'random-4', }, }); expect(JSON.parse(relay.calls.at(-1)!.body!)).toEqual({ - verifierHash: await challenge('random-3'), + verifierHash: await challenge('random-4'), name: 'iPhone', }); if (!offer.ok) throw new Error('missing enrollment'); @@ -188,19 +190,25 @@ describe('phone Connect account', () => { forged.authorize.mockResolvedValueOnce(`${REDIRECT}?code=x&state=other` as never); expect(await forged.account.signIn()).toEqual({ ok: false, code: 'sign-in-failed' }); await forged.account.signIn(); - await forged.account.signOut(); + await forged.account.signOut((await forged.account.actionKey())!); expect(await forged.account.email()).toBeNull(); }); it('deletes the account at the relay and forgets the session only when it succeeds', async () => { const failing = fakeRelay({ deletion: 502 }); await failing.account.signIn(); - expect(await failing.account.deleteAccount()).toEqual({ ok: false, code: 'relay-unavailable' }); + expect(await failing.account.deleteAccount((await failing.account.actionKey())!)).toEqual({ + ok: false, + code: 'account-deletion-uncertain', + }); expect(await failing.account.email()).toBe('alice@example.com'); const relay = fakeRelay(); await relay.account.signIn(); - expect(await relay.account.deleteAccount()).toEqual({ ok: true, value: undefined }); + expect(await relay.account.deleteAccount((await relay.account.actionKey())!)).toEqual({ + ok: true, + value: undefined, + }); expect(relay.calls.at(-1)).toEqual({ url: `${RELAY}/v1/account`, method: 'DELETE', diff --git a/apps/mobile/test/conversation-filter.test.ts b/apps/mobile/test/conversation-filter.test.ts index c6ed077671..7c4081bb6e 100644 --- a/apps/mobile/test/conversation-filter.test.ts +++ b/apps/mobile/test/conversation-filter.test.ts @@ -17,3 +17,22 @@ it('restores a source-scoped choice and does not overwrite a newer choice during expect(next.getSnapshot()).toBe(value); expect(next.getSnapshot()).toContain('org_b'); }); + +it('retains a failed account filter reset for a durable retry', async () => { + let disk = 'owned'; + let failed = true; + const filter = createConversationFilter({ + read: async () => disk, + write: (value) => { + if (failed) throw new Error('disk'); + disk = value; + }, + }); + await filter.ready; + await expect(filter.clearPersisted('owned')).rejects.toThrow('disk'); + expect(filter.getSnapshot()).toBe('owned'); + failed = false; + await filter.clearPersisted('owned'); + expect(disk).toBe('all'); + expect(filter.getSnapshot()).toBe('all'); +}); diff --git a/apps/mobile/test/host-session-unpair.test.ts b/apps/mobile/test/host-session-unpair.test.ts index ef5ebc8ca1..a86b081255 100644 --- a/apps/mobile/test/host-session-unpair.test.ts +++ b/apps/mobile/test/host-session-unpair.test.ts @@ -7,12 +7,19 @@ const secure = new Map(); const quickActions = vi.hoisted(() => ({ items: [] as Array<{ id: string }> })); const clearedCaches = vi.hoisted(() => [] as string[]); const forgotten = vi.hoisted(() => [] as string[]); +const clearCache = vi.hoisted(() => vi.fn((hostId: string) => void clearedCaches.push(hostId))); +const clearDrafts = vi.hoisted(() => vi.fn(async () => {})); +const clientStops = vi.hoisted(() => vi.fn()); +let beforeRead: ((key: string) => Promise) | undefined; let beforeSave: ((key: string, value: string) => Promise) | undefined; let savedFilter = 'all'; vi.mock('expo-secure-store', () => ({ WHEN_UNLOCKED_THIS_DEVICE_ONLY: 0, - getItemAsync: async (key: string) => secure.get(key) ?? null, + getItemAsync: async (key: string) => { + await beforeRead?.(key); + return secure.get(key) ?? null; + }, setItemAsync: async (key: string, value: string) => { await beforeSave?.(key, value); secure.set(key, value); @@ -34,12 +41,16 @@ vi.mock('react-native', () => ({ }, })); vi.mock('../src/host/native-source-drafts', () => ({ - sourceDrafts: { ready: Promise.resolve(), removeWhere: () => undefined }, + sourceDrafts: { + ready: Promise.resolve(), + removeWhere: () => undefined, + removePersistedWhere: clearDrafts, + }, })); vi.mock('../src/host/conversation', () => ({ createConversation: vi.fn() })); vi.mock('../src/host/conversation-playback', () => ({ createConversationPlayback: vi.fn() })); vi.mock('../src/host/native-cache', () => ({ - clearHostConversationCache: (hostId: string) => void clearedCaches.push(hostId), + clearHostConversationCache: clearCache, nativeConversationCache: {}, })); vi.mock('../src/host/native-conversation-filter', async () => { @@ -81,7 +92,7 @@ vi.mock('../src/telemetry/connection', () => ({ vi.mock('../src/host/client', () => ({ createHostClient: () => ({ start() {}, - stop() {}, + stop: clientStops, retryNow() {}, subscribe: () => () => {}, getSnapshot: () => ({ connection: { status: 'connecting', route: '' } }), @@ -138,11 +149,14 @@ const savedIds = () => ).hosts.map((entry) => entry.hostId); beforeEach(() => { + clearCache.mockClear(); + clearDrafts.mockClear(); secure.clear(); quickActions.items = []; clearedCaches.length = 0; forgotten.length = 0; beforeSave = undefined; + beforeRead = undefined; savedFilter = 'all'; vi.resetModules(); }); @@ -270,3 +284,141 @@ describe('drawer selection through the real Host Session', () => { await expectSelection('b', 'all'); }); }); + +it('removes account-owned connections through the real session and stops its client, preserving manual records', async () => { + const owner = { + issuer: 'https://api.workos.com' as const, + relay: 'https://fixture.invalid', + clientId: 'client_fixture', + subject: 'user_a', + }; + secure.set( + 'deepseekbot.hosts.v3', + JSON.stringify({ + hosts: [{ ...host('old'), accountOwner: owner }, host('new')], + current: 'old', + }), + ); + const { hostSession } = await import('../src/host/host-session'); + await vi.waitFor(() => expect(hostSession.getState().hosts).toHaveLength(2)); + clientStops.mockClear(); + await hostSession.removeAccount(owner); + expect(savedIds()).toEqual(['new']); + expect(hostSession.getState().hosts.map((host) => host.hostId)).toEqual(['new']); + expect(clientStops).toHaveBeenCalledTimes(1); + expect(forgotten).toContain('old'); + expect(forgotten).not.toContain('new'); + expect(clearedCaches).toEqual(['old']); + expect(parseSavedHosts(secure.get('deepseekbot.hosts.v3')).pendingAccountRemoval).toBeUndefined(); +}); + +it.each(['draft', 'cache', 'recent'] as const)( + 'retains the account cleanup journal after a required %s failure, then retries', + async (failure) => { + const owner = { + issuer: 'https://api.workos.com' as const, + relay: 'https://fixture.invalid', + clientId: 'client_fixture', + subject: 'user_a', + }; + secure.set( + 'deepseekbot.hosts.v3', + JSON.stringify({ + hosts: [{ ...host('old'), accountOwner: owner }, host('new')], + current: 'old', + }), + ); + secure.set( + 'deepseekbot.recent-chats.v1', + JSON.stringify([chat('writer', 'old'), chat('coder', 'new')]), + ); + const { hostSession } = await import('../src/host/host-session'); + await vi.waitFor(() => expect(hostSession.getState().hosts).toHaveLength(2)); + if (failure === 'draft') clearDrafts.mockRejectedValueOnce(new Error('disk')); + if (failure === 'cache') + clearCache.mockImplementationOnce(() => { + throw new Error('disk'); + }); + if (failure === 'recent') + beforeSave = async (key) => { + if (key === 'deepseekbot.recent-chats.v1') throw new Error('disk'); + }; + await expect(hostSession.removeAccount(owner)).rejects.toThrow('disk'); + expect(savedIds()).toEqual(['new']); + expect( + parseSavedHosts(secure.get('deepseekbot.hosts.v3')).pendingAccountRemoval?.map( + (host) => host.hostId, + ), + ).toEqual(['old']); + beforeSave = undefined; + await hostSession.removeAccount(owner); + expect( + parseSavedHosts(secure.get('deepseekbot.hosts.v3')).pendingAccountRemoval, + ).toBeUndefined(); + expect( + JSON.parse(secure.get('deepseekbot.recent-chats.v1')!).map((chat: { id: string }) => chat.id), + ).toEqual(['coder']); + }, +); + +it.each([false, true])( + 'does not finish account cleanup from an unreadable store (pending journal: %s)', + async (pending) => { + const owner = { + issuer: 'https://api.workos.com' as const, + relay: 'https://fixture.invalid', + clientId: 'client_fixture', + subject: 'user_a', + }; + const owned = { ...host('old'), accountOwner: owner }; + const original = JSON.stringify( + pending + ? { hosts: [host('new')], pendingAccountRemoval: [owned] } + : { hosts: [owned, host('new')], current: 'old' }, + ); + secure.set('deepseekbot.hosts.v3', original); + beforeRead = async (key) => { + if (key === 'deepseekbot.hosts.v3') throw new Error('storage unavailable'); + }; + const { hostSession } = await import('../src/host/host-session'); + await vi.waitFor(() => expect(hostSession.getState().saved).toBeNull()); + const { createConnectAccount } = await import('../src/host/connect-account'); + let storedAccount: string | null = JSON.stringify({ + clientId: owner.clientId, + refreshToken: 'fixture', + subject: owner.subject, + sessionId: 'fixture-sign-in', + }); + const account = createConnectAccount({ + relay: owner.relay, + redirectUri: 'fixture:/callback', + removeConnections: (owner) => hostSession.removeAccount(owner), + runtime: { + read: async () => storedAccount, + write: async (value) => { + storedAccount = value; + }, + request: async () => { + throw new Error('no network allowed'); + }, + random: () => 'unused', + challenge: async (value) => value, + authorize: async () => null, + now: () => 0, + }, + }); + const key = (await account.actionKey())!; + expect(await account.signOut(key)).toEqual({ ok: false, code: 'account-cleanup-failed' }); + expect(JSON.parse(storedAccount!).action).toBe('signOut'); + expect(secure.get('deepseekbot.hosts.v3')).toBe(original); + expect(clearedCaches).toEqual([]); + beforeRead = undefined; + expect(await account.signOut(key)).toEqual({ ok: true, value: undefined }); + expect(storedAccount).toBeNull(); + expect(savedIds()).toEqual(['new']); + expect( + parseSavedHosts(secure.get('deepseekbot.hosts.v3')).pendingAccountRemoval, + ).toBeUndefined(); + expect(clearedCaches).toEqual(['old']); + }, +); diff --git a/apps/mobile/test/source-drafts.test.ts b/apps/mobile/test/source-drafts.test.ts index db25d7dcb0..08499286e0 100644 --- a/apps/mobile/test/source-drafts.test.ts +++ b/apps/mobile/test/source-drafts.test.ts @@ -43,3 +43,46 @@ describe('unsent source drafts', () => { expect(drafts.get('channel')).toBe('New input'); }); }); + +it('keeps required draft removal retryable after a disk write or read failure', async () => { + const own = hostDraftKey('a', 'channel', 'one'); + const other = hostDraftKey('b', 'channel', 'two'); + let disk: Record = { [own]: 'private draft', [other]: 'keep' }; + let failed = true; + const drafts = createSourceDrafts({ + read: async () => ({ ...disk }), + write: (next, required) => { + if (required && failed) throw new Error('disk full'); + disk = { ...next }; + }, + }); + await drafts.ready; + await expect(drafts.removePersistedWhere((key) => key === own)).rejects.toThrow('disk full'); + expect(drafts.get(own)).toBe('private draft'); + expect(disk[own]).toBe('private draft'); + failed = false; + await drafts.removePersistedWhere((key) => key === own); + expect(disk).toEqual({ [other]: 'keep' }); + expect(drafts.get(own)).toBe(''); +}); + +it('does not discard persisted drafts when initial hydration failed', async () => { + let unavailable = true; + let disk: Record = { own: 'private', other: 'keep' }; + const drafts = createSourceDrafts({ + read: async () => { + if (unavailable) throw new Error('read unavailable'); + return { ...disk }; + }, + write: (next) => { + disk = { ...next }; + }, + }); + await drafts.ready; + await expect(drafts.removePersistedWhere((key) => key === 'own')).rejects.toThrow( + 'read unavailable', + ); + unavailable = false; + await drafts.removePersistedWhere((key) => key === 'own'); + expect(disk).toEqual({ other: 'keep' }); +}); diff --git a/changes/2581-account-action-icons.md b/changes/2581-account-action-icons.md new file mode 100644 index 0000000000..a68a2662c5 --- /dev/null +++ b/changes/2581-account-action-icons.md @@ -0,0 +1,11 @@ +--- +section: Fixed +--- + +## en + +- Applied danger color directly to the iOS account action symbols and aligned them in a shared icon slot, including an optical adjustment for Sign out ([#2581](https://github.com/BotHarness/DeepSeekBot/issues/2581)). + +## zh + +- iOS 账户操作图标直接使用危险操作颜色,并在统一图标槽内对齐,同时校正“退出登录”图形的视觉中心([#2581](https://github.com/BotHarness/DeepSeekBot/issues/2581))。 diff --git a/changes/2603-account-action-confirmation.md b/changes/2603-account-action-confirmation.md new file mode 100644 index 0000000000..9e5d6c5e5d --- /dev/null +++ b/changes/2603-account-action-confirmation.md @@ -0,0 +1,11 @@ +--- +section: Fixed +--- + +## en + +- Sign out and Delete account now require confirmation explaining their different effects. Confirmed actions remove this phone’s connections recorded as belonging to that account, preserve manual and older unassigned pairings, and retain recovery state when cleanup or deletion is incomplete, with an explicitly confirmed phone-only recovery when the remote result is unknown ([#2603](https://github.com/BotHarness/DeepSeekBot/issues/2603)). + +## zh + +- 退出登录和删除账号均需二次确认,并说明各自影响。确认后移除此手机中已记录归属该账号的连接,保留手动和未记录归属的旧配对;清理或删除未完成时保留恢复状态,远端结果未知时可再次确认仅清理此手机([#2603](https://github.com/BotHarness/DeepSeekBot/issues/2603))。 diff --git a/docs/adr/0241-hosted-connect-reaches-the-host-through-a-managed-tunnel.md b/docs/adr/0241-hosted-connect-reaches-the-host-through-a-managed-tunnel.md index 7fea464af0..375166ca10 100644 --- a/docs/adr/0241-hosted-connect-reaches-the-host-through-a-managed-tunnel.md +++ b/docs/adr/0241-hosted-connect-reaches-the-host-through-a-managed-tunnel.md @@ -60,3 +60,15 @@ One isolated Host and the iOS Simulator, against a test Cloudflare account and a ## Amendment — ADR-0244 (2026-10-22) [ADR-0244](0244-connect-encrypts-device-traffic-against-pinned-host-keys.md) supersedes account-only automatic enrollment and plaintext Connect application transport. The relay returns signed account enrollment metadata and a public Host-key hint; the client independently checks the fingerprint. The Host creates/redeems the offer inside Noise only after exact device-key approval. The browser uses its trusted serving Host's origin-local key store. The full phone WebView remains removed on every route; private input now uses the native form. Viewer signaling/media on Connect are unavailable until separately qualified. See the [wire contract](../architecture/connect-channel-v1.md); source implementation does not establish native or deployed-network qualification. + +## Amendment — confirmed phone account actions (2026-10-23, #2603) + +The phone account session and per-Host device credentials remain separate authorities. Both Sign out and Delete account require a native confirmation describing their different effects; opening or cancelling the dialog does not mutate either authority. Confirmation is bound to the current local sign-in instance and expires when the account page changes or the operation becomes busy. + +New account-mediated pairings record the WorkOS subject returned by the authenticated token exchange, the issuer, OAuth client and relay origin. The phone serializes their final save with account actions. It never infers ownership from email, Host membership, route hostname or manual pairing payloads. Existing records without provenance stay unassigned; a successful refresh persists a stable sign-in-instance identifier and may establish account identity for future pairings but does not migrate old Host credentials into that account. + +Confirmed Sign out removes the phone session and only connections with matching recorded ownership. It stops their local clients and performs local cache/draft cleanup and best-effort push unregistration; it does not globally unlink Hosts, revoke other devices, or delete remote Host data. Delete account additionally retains the relay's existing account-wide tunnel/DNS/link and WorkOS-user deletion. A manual pairing record stays, but a Connect route backed by a deleted tunnel no longer works. + +Account action progress lives in the existing account SecureStore record. A completed remote-delete marker allows local cleanup retries without another remote request. A pending-delete marker means the remote outcome may be partial or unknown; expired authentication cannot establish completion and requires support rather than an invented rollback. Observed remote success survives a failed completion-marker write in process memory for local retry; after restart, only the persisted marker is trusted. A separate, explicitly confirmed “Clear this phone only” action can finish local cleanup without authentication while making no claim about remote deletion. Its local-only marker forbids another remote deletion attempt; checking or finishing the remote outcome requires support. The existing paired-Host store retains removed entries in a pending-cleanup journal until required draft, conversation-cache, recent-chat/shortcut and filter writes complete; the active Host list excludes them. Mutations are serialized, and re-pairing a pending Host is refused until cleanup finishes. An explicitly empty paired-Host list is authoritative over legacy single-Host storage. These recovery records are not a second account or pairing authority. + +Native confirmation and fixture qualification are distinct from real WorkOS/Cloudflare deletion qualification. Development fixtures use injected memory stores and a closed request substitute; they cannot authorize testing on a Human account. See [#2603](https://github.com/BotHarness/DeepSeekBot/issues/2603) for the implementation and acceptance scope. diff --git a/docs/architecture/botharness-architecture.md b/docs/architecture/botharness-architecture.md index fdafae9995..c18cf99f87 100644 --- a/docs/architecture/botharness-architecture.md +++ b/docs/architecture/botharness-architecture.md @@ -1236,3 +1236,9 @@ The cloudflared-only origin accepts `/botharness-device/channel` and refuses leg Native private input uses masked fields and the existing credential owner; values stay outside chat drafts, messages and telemetry. The phone's full Host WebView remains removed on every route. Browser/Computer viewers are explicitly unavailable on Connect pending their own media/signaling qualification; the Host and Tailscale remain available. The browser requires independently trusted serving code and origin-local key storage; it does not claim hardware protection. [ADR-0244](../adr/0244-connect-encrypts-device-traffic-against-pinned-host-keys.md) is approved. Its implementation, protocol vectors, runtime evidence, native acceptance, independent security review and deployment are separate gates; a green source test is not proof of a real phone through Cloudflare. The [Track A audit](../research/2026-10-22-connect-secret-safety-audit.md) remains historical evidence for the interim refusal. + +### Mobile Connect account actions + +The application-defined mobile account session and saved Host credentials remain separate. Native Sign out/Delete confirmations bind to the current sign-in instance. Only newly recorded account-mediated pairings carry trusted issuer/relay/client/subject provenance; manual and legacy unknown-source records are preserved. Confirmed Sign out removes owned phone connections and the local account session. Delete also invokes the existing account-wide Connect unlink and WorkOS deletion, without deleting remote Host files, Bots or chats. Account action markers and a pending-cleanup journal in the existing SecureStore records preserve recovery across partial failures; they are not transactional rollback. Observed remote success enables a local retry even when the completion-marker write fails; after restart, an unknown result offers separately confirmed local-only cleanup, with remote deletion explicitly unresolved. Required local storage failures retain the cleanup journal. See the [ADR-0241 account-action amendment](../adr/0241-hosted-connect-reaches-the-host-through-a-managed-tunnel.md#amendment--confirmed-phone-account-actions-2026-10-23-2603). + +应用定义的手机账号会话与 Host 配对凭据仍是独立权威。退出与删除的原生确认绑定当前登录实例;只有新建的账号配对记录可信来源,手动及来源不明的旧记录会保留。退出清理归属该账号的手机连接与本地登录;删除另执行既有的账号级 Connect 解绑及 WorkOS 删除,不删除远程文件、Bot 或聊天。现有 SecureStore 中的操作标记和清理待办支持部分失败后的恢复,不承诺事务回滚;真实账号删除与原生安全 fixture 验收分别成立。