diff options
| author | Christophe Besson <cbesson@gmail.com> | 2026-10-10 17:09:12 +0200 |
|---|---|---|
| committer | Christophe Besson <cbesson@gmail.com> | 2026-10-10 17:09:12 +0200 |
| commit | b39e73cbb279ab0274e8cd0b84304a602fe1d5ef (patch) | |
| tree | 91e86b70289f5c0252372f4f05b83b38f049c64f /packages/meshbay-hub/src/meshbay_hub/static/platform.js | |
| parent | ff982773308d042e4ec68fae9cad5c5742bc7395 (diff) | |
| download | meshbay-b39e73cbb279ab0274e8cd0b84304a602fe1d5ef.tar.gz | |
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 <noreply@anthropic.com>
Diffstat (limited to 'packages/meshbay-hub/src/meshbay_hub/static/platform.js')
| -rw-r--r-- | packages/meshbay-hub/src/meshbay_hub/static/platform.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/platform.js b/packages/meshbay-hub/src/meshbay_hub/static/platform.js index 596c327..47e3a72 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/platform.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/platform.js @@ -255,15 +255,17 @@ export const photoSync = { /** * A file the phone issued under `token`, as what an upload reads (`name`, * `size`, `slice(a, b).arrayBuffer()`): each slice is fetched from the phone - * when it is read, so a video of gigabytes is never whole in this page. + * when it is read, so a video of gigabytes is never whole in this page. The + * slice is in the address (`?range=a-b`), not a Range header: the WebView + * does not hand that header to the application that answers. */ function rangedFile(prefix, token, name, size) { const url = `${prefix}${encodeURIComponent(token)}`; const part = (start, end) => ({ async arrayBuffer() { if (end <= start) return new ArrayBuffer(0); - const r = await fetch(url, { cache: 'no-store', headers: { Range: `bytes=${start}-${end - 1}` } }); - if (r.status !== 206) throw new Error('This file is no longer on the phone'); + const r = await fetch(`${url}?range=${start}-${end - 1}`, { cache: 'no-store' }); + if (!r.ok) throw new Error('This file is no longer on the phone'); return r.arrayBuffer(); }, }); @@ -343,6 +345,7 @@ function docSync(name) { sent(token, dir, n) { return b.sent(token, dir, n); }, completed() { return b.completed(); }, failed(code, text) { return b.failed(code, text); }, + openSettings() { return b.openSettings(); }, /** The file the last plan wrote, as a File named for the node. */ async file(token, fileName) { const r = await fetch(`/phonesync/${encodeURIComponent(token)}`, { cache: 'no-store' }); |