diff --git a/packaging/fetch-clients.sh b/packaging/fetch-clients.sh index 480cdb9..4b96266 100755 --- a/packaging/fetch-clients.sh +++ b/packaging/fetch-clients.sh @@ -69,7 +69,12 @@ digest() { sha256sum "$1" | cut -d' ' -f1; } # whole one. sidecar() { _file="$1"; _out="$2"; _name="$3"; _code="$4" - printf '{\n "version_name": "%s",\n "version_code": %s,\n "size": %s,\n "sha256": "%s"\n}\n' \ + # `version_code` is QUOTED here, and that is not a slip. This function only ever + # writes DESKTOP sidecars, whose ordering key is Tauri's `1.0.` — which + # unquoted is not valid JSON at all, so every sidecar this wrote would fail to + # parse and the server would advertise nothing. Android's sidecar is a different + # file, copied verbatim from its lane, and keeps its integer. + printf '{\n "version_name": "%s",\n "version_code": "%s",\n "size": %s,\n "sha256": "%s"\n}\n' \ "$_name" "$_code" "$(bytes "$_file")" "$(digest "$_file")" > "$_out" } diff --git a/src/thoughtsync/client_dist.py b/src/thoughtsync/client_dist.py index a85c6c0..6cba4be 100644 --- a/src/thoughtsync/client_dist.py +++ b/src/thoughtsync/client_dist.py @@ -263,7 +263,10 @@ def _resolve(platform: Platform) -> tuple[Path, dict] | None: broken or half-copied pair does NOT shadow the image: it simply is not a client, so the search moves on. """ - for root in (Path(Config.client_root()), BAKED_ROOT): + # Both wrapped in Path(), not just the first. The asymmetry was arbitrary and it + # fails quietly: `_read` catches the TypeError a str `/` str raises and reports + # "no client here", so a directory that is perfectly fine reads as empty. + for root in (Path(Config.client_root()), Path(BAKED_ROOT)): release = _read(root, platform) if release is not None: return root, release