Changeset da71f9d in Klonkt


Ignore:
Timestamp:
07/04/2026 05:47:49 PM (2 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
8e7f0ec
Parents:
0a93c15
Message:

fix(updates): Android "Latest" reads the installable bundle version

The Android Updates page read the stable branch's package.json, which
runs ahead of the phone bundle during the CI window in which the bundle
is still being built - the page showed "1.3.4 available" while the
update button could only install the 1.3.3 tarball, so updating
appeared stuck on the same version.

"Latest" now reads BUILD-INFO.txt's new bundle-version line from the
release (= exactly what klonkt-update installs), falling back to the
stable branch for releases that predate the line. Parse logic verified
against the workflow's BUILD-INFO shape (with and without the line).

  • src/routes/admin-updates.js - androidLatestVersion(): BUILD-INFO first, stable-branch fallback; shared fetchWithTimeout helper
  • CHANGELOG(.nl/.de).md - Unreleased entry (3 languages)

Co-Authored-By: Claude <noreply@…>

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • CHANGELOG.de.md

    r0a93c15 rda71f9d  
    1010  Musik oder Embed wurde ohne Cover föderiert, sodass eine geteilte Umfrage eine
    1111  leere Kachel zeigte; das Cover reist jetzt mit.
     12- **Die Updates-Seite der Android-App zeigt, was wirklich installierbar ist.**
     13  Sie las den neuesten Release-Branch, der der Handy-Build kurzzeitig
     14  vorauslaufen konnte — Aktualisieren installierte dann dieselbe Version erneut.
     15  Sie liest jetzt die Version des Handy-Bundles selbst.
    1216
    1317## [1.3.4] — 2026-07-04
  • CHANGELOG.md

    r0a93c15 rda71f9d  
    1010  federating without its cover, so a boosted poll showed a blank tile; the cover
    1111  now travels with it.
     12- **The Android app's Updates page shows what's actually installable.** It read
     13  the newest release branch, which could be ahead of the phone build for a short
     14  while — pressing update then reinstalled the same version. It now reads the
     15  version of the phone bundle itself.
    1216
    1317## [1.3.4] — 2026-07-04
  • CHANGELOG.nl.md

    r0a93c15 rda71f9d  
    1010  embed federeerde zonder cover, waardoor een geboooste poll een leeg vak toonde;
    1111  de cover reist nu mee.
     12- **De Updates-pagina van de Android-app toont wat er écht te installeren valt.**
     13  Hij las de nieuwste release-branch, die korte tijd vóór kon lopen op de
     14  telefoon-build — bijwerken installeerde dan dezelfde versie opnieuw. Hij leest
     15  nu de versie van de telefoonbundel zelf.
    1216
    1317## [1.3.4] — 2026-07-04
  • src/routes/admin-updates.js

    r0a93c15 rda71f9d  
    4545const IS_ANDROID = process.platform === 'android'
    4646  || (() => { try { return fs.existsSync('/data/data/com.termux/files/usr/bin'); } catch { return false; } })();
    47 // Phone tarballs are built from the stable branch → that's the phone's "latest".
    48 const ANDROID_LATEST_URL = 'https://raw.githubusercontent.com/roboburr/klonkt/stable/package.json';
     47// "Latest" for a phone = what the update button can actually INSTALL: the version
     48// of the prebuilt bundle on the release (BUILD-INFO.txt's bundle-version). Reading
     49// the stable branch instead showed a new version during the CI window in which the
     50// bundle was still being built — pressing update then reinstalled the old version.
     51const ANDROID_BUILDINFO_URL = 'https://github.com/roboburr/klonkt-android/releases/download/termux-latest/BUILD-INFO.txt';
     52const ANDROID_STABLE_URL = 'https://raw.githubusercontent.com/roboburr/klonkt/stable/package.json';
     53
     54async function fetchWithTimeout(url, ms) {
     55  const ctl = new AbortController();
     56  const t = setTimeout(() => ctl.abort(), ms);
     57  try { return await fetch(url, { signal: ctl.signal, redirect: 'follow' }); }
     58  finally { clearTimeout(t); }
     59}
    4960
    5061async function androidLatestVersion() {
    5162  try {
    52     const ctl = new AbortController();
    53     const t = setTimeout(() => ctl.abort(), 8000);
    54     const r = await fetch(ANDROID_LATEST_URL, { signal: ctl.signal });
    55     clearTimeout(t);
     63    const r = await fetchWithTimeout(ANDROID_BUILDINFO_URL, 8000);
     64    if (r.ok) {
     65      const m = (await r.text()).match(/^bundle-version:\s*(\S+)/m);
     66      if (m) return m[1];
     67    }
     68  } catch { /* fall through */ }
     69  // Older releases have no bundle-version line → fall back to the stable branch.
     70  try {
     71    const r = await fetchWithTimeout(ANDROID_STABLE_URL, 8000);
    5672    if (!r.ok) return null;
    5773    return (await r.json()).version || null;
Note: See TracChangeset for help on using the changeset viewer.