From a0793dd37030f7213ecb07a018b11e6a8adf9238 Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Sat, 10 Oct 2026 12:56:26 +0200 Subject: feat(android): back the phone's contacts up to a group of one's own A Contacts backup section on the Android Sync page sends a dated .vcf into /-contacts once a day when the address book changed, only to a group the account is alone in, checked again at every run. Co-Authored-By: Claude Opus 5.5 --- packages/meshbay-hub/tests/test_android_shell.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'packages/meshbay-hub/tests/test_android_shell.py') diff --git a/packages/meshbay-hub/tests/test_android_shell.py b/packages/meshbay-hub/tests/test_android_shell.py index 5262aae..b92cfef 100644 --- a/packages/meshbay-hub/tests/test_android_shell.py +++ b/packages/meshbay-hub/tests/test_android_shell.py @@ -138,12 +138,16 @@ def test_the_shim_offers_desktop_channels_and_native_answers_each(): SRC / "cast" / "CastChannels.kt", SRC / "notify" / "PushChannels.kt", SRC / "photos" / "PhotoChannels.kt"): native |= set(re.findall(r'^\s*"([\w:-]+)" ->', _read(path), flags=re.M)) + # Contacts and messages share one class, its channels named by a prefix. + docs = set(re.findall(r'^\s*"(\w+)" ->', _read(SRC / "phonesync" / "DocChannels.kt"), flags=re.M)) + for prefix in re.findall(r'DocChannels\("(\w+)"', _read(SRC / "MainActivity.kt")): + native |= {f"{prefix}:{name}" for name in docs} shim = _shim_channels() assert shim, "no channel found in the shim" - # A phone has a push distributor to talk to and a camera roll to back up, - # and a desktop has neither; those families are the ones the desktop lacks + # A phone has a push distributor to talk to and a camera roll and an + # address book to back up, and a desktop has none of them; those families are the ones the desktop lacks # rather than the ones it shares. - phone_only = {c for c in shim if c.startswith(("push:", "photosync:"))} + phone_only = {c for c in shim if c.startswith(("push:", "photosync:", "contactsync:"))} assert any(c.startswith("push:") for c in phone_only), "the push channels are gone" assert any(c.startswith("photosync:") for c in phone_only), "the backup channels are gone" assert shim - phone_only <= preload, f"channels the desktop does not have: {shim - preload}" -- cgit v1.2.3