From b39e73cbb279ab0274e8cd0b84304a602fe1d5ef Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Sat, 10 Oct 2026 17:09:12 +0200 Subject: fix(android): what the first backup on a phone showed Slices are asked for in the address, not a Range header the WebView drops; a settings change runs at once; the notification is updated once a second; the SMS section says how to lift Android's restricted setting; the photo section says whether videos are included. Co-Authored-By: Claude Opus 5.5 --- packages/meshbay-hub/tests/test_android_shell.py | 2 +- packages/meshbay-hub/tests/test_drive_sync.py | 10 +++++----- packages/meshbay-hub/tests/test_photo_sync.py | 11 ++++++----- 3 files changed, 12 insertions(+), 11 deletions(-) (limited to 'packages/meshbay-hub/tests') diff --git a/packages/meshbay-hub/tests/test_android_shell.py b/packages/meshbay-hub/tests/test_android_shell.py index 001f6d9..cd5a36e 100644 --- a/packages/meshbay-hub/tests/test_android_shell.py +++ b/packages/meshbay-hub/tests/test_android_shell.py @@ -139,7 +139,7 @@ def test_the_shim_offers_desktop_channels_and_native_answers_each(): SRC / "photos" / "PhotoChannels.kt", SRC / "phonesync" / "Destination.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)) + 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} # The chosen-folder backups too, their prefixes in DriveKind.kt. diff --git a/packages/meshbay-hub/tests/test_drive_sync.py b/packages/meshbay-hub/tests/test_drive_sync.py index 342b310..3861585 100644 --- a/packages/meshbay-hub/tests/test_drive_sync.py +++ b/packages/meshbay-hub/tests/test_drive_sync.py @@ -41,11 +41,11 @@ doc.visibilityState = 'visible'; globalThis.window = win; globalThis.document = doc; globalThis.localStorage = { getItem() { return null; }, setItem() {}, removeItem() {} }; -globalThis.fetch = async (url, opts) => { - const range = opts && opts.headers && opts.headers.Range; - fake.log.push(['fetch', url, range || null]); - const m = /bytes=(\d+)-(\d+)/.exec(range || ''); - return { ok: true, status: m ? 206 : 200, +globalThis.fetch = async (url) => { + const [path, query] = url.split('?'); + const m = /range=(\d+)-(\d+)/.exec(query || ''); + fake.log.push(['fetch', path, m ? `bytes=${m[1]}-${m[2]}` : null]); + return { ok: true, status: 200, arrayBuffer: async () => new ArrayBuffer(m ? Number(m[2]) - Number(m[1]) + 1 : 0) }; }; fake.status = { diff --git a/packages/meshbay-hub/tests/test_photo_sync.py b/packages/meshbay-hub/tests/test_photo_sync.py index 266a111..9ade08b 100644 --- a/packages/meshbay-hub/tests/test_photo_sync.py +++ b/packages/meshbay-hub/tests/test_photo_sync.py @@ -57,12 +57,13 @@ doc.visibilityState = 'visible'; globalThis.window = win; globalThis.document = doc; globalThis.localStorage = { getItem() { return null; }, setItem() {}, removeItem() {} }; -globalThis.fetch = async (url, opts) => { - const range = opts && opts.headers && opts.headers.Range; - fake.log.push(['fetch', url, range || null]); - const m = /bytes=(\d+)-(\d+)/.exec(range || ''); +globalThis.fetch = async (url) => { + // The slice is in the address (platform.js rangedFile), never a header. + const [path, query] = url.split('?'); + const m = /range=(\d+)-(\d+)/.exec(query || ''); + fake.log.push(['fetch', path, m ? `bytes=${m[1]}-${m[2]}` : null]); const n = m ? Number(m[2]) - Number(m[1]) + 1 : 4; - return { ok: true, status: m ? 206 : 200, arrayBuffer: async () => new ArrayBuffer(n), + return { ok: true, status: 200, arrayBuffer: async () => new ArrayBuffer(n), blob: async () => new Blob([new Uint8Array(n)]) }; }; -- cgit v1.2.3