Changeset 6dd1a3f in Klonkt


Ignore:
Timestamp:
07/04/2026 05:26:26 PM (2 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
14f54a7
Parents:
236e11b
Message:

fix(ap): upsertBoostedNote refreshes an already-cached row

Root cause of "cover still missing on sound-fabrics" after both earlier
fixes: the self-heal is once-per-version and silently skips a note whose
fetch fails at that moment (the phone-hosted origin was briefly
unreachable when v6 ran), and upsertBoostedNote was INSERT OR IGNORE
only - so the stale coverless row could never be repaired, not even by
boosting the post again.

Now, when the INSERT is ignored because the row exists, the row is
UPDATEd with the freshly resolved note (content, media/cover, nsfw, cw,
url). Boosting a post again therefore always heals its cached copy.

Verified in isolation against the real schema: stale coverless row +
re-boost -> cover present, content refreshed. Suite 45/45.

  • src/services/ActivityPubService.js - update branch in upsertBoostedNote
  • CHANGELOG(.nl/.de).md - extended the existing Unreleased bullet (3 languages)

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

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • CHANGELOG.de.md

    r236e11b r6dd1a3f  
    99- **Boosts, die ihr Cover verloren hatten, bekommen es automatisch zurück.**
    1010  Beiträge, die du vor dem Cover-Fix geboostet hast, waren ohne Artwork
    11   gespeichert; sie werden beim nächsten Neustart einmalig aufgefrischt.
     11  gespeichert; sie werden beim nächsten Neustart einmalig aufgefrischt. Einen
     12  Beitrag erneut zu boosten aktualisiert jetzt ebenfalls die gespeicherte Kopie
     13  (Cover, Inhalt) — ein veralteter Boost lässt sich also auch von Hand heilen.
    1214
    1315## [1.3.3] — 2026-07-03
  • CHANGELOG.md

    r236e11b r6dd1a3f  
    99- **Boosts that lost their cover get it back automatically.** Posts you boosted
    1010  before the cover fix were cached without their artwork; they are refreshed
    11   once on the next restart.
     11  once on the next restart. Boosting a post again now also refreshes its cached
     12  copy (cover, content), so a stale boost can always be healed by hand too.
    1213
    1314## [1.3.3] — 2026-07-03
  • CHANGELOG.nl.md

    r236e11b r6dd1a3f  
    99- **Boosts die hun cover kwijt waren krijgen 'm automatisch terug.** Posts die
    1010  je vóór de cover-fix boostte waren zonder artwork opgeslagen; die worden bij
    11   de volgende herstart eenmalig ververst.
     11  de volgende herstart eenmalig ververst. Een post opnieuw boosten ververst nu
     12  ook de opgeslagen kopie (cover, inhoud), dus een oude boost is altijd ook
     13  handmatig te genezen.
    1214
    1315## [1.3.3] — 2026-07-03
  • src/services/ActivityPubService.js

    r236e11b r6dd1a3f  
    18391839  const media = JSON.stringify((note.images || []).map((u) => ({ url: u, type: 'image/jpeg' })));
    18401840  try {
    1841     tlStmts().ins.run(id, slug, note.actor_uri || '', note.actor_name || '', note.actor_handle || '',
     1841    const r = tlStmts().ins.run(id, slug, note.actor_uri || '', note.actor_name || '', note.actor_handle || '',
    18421842      note.actor_icon || '', note.actor_url || '', note.content || '', note.url || null,
    18431843      new Date().toISOString(), media, note.sensitive ? 1 : 0, note.cw || null);
     1844    if (!r.changes) {
     1845      // Row already cached (INSERT OR IGNORE) → refresh it with the freshly
     1846      // resolved note. Without this a row cached without its cover (or with
     1847      // stale content) stayed stale forever — even boosting again didn't heal it.
     1848      db.prepare('UPDATE ap_timeline SET content = ?, media_json = ?, nsfw = ?, cw = ?, url = COALESCE(?, url) WHERE slug = ? AND id = ?')
     1849        .run(note.content || '', media, note.sensitive ? 1 : 0, note.cw || null, note.url || null, slug, id);
     1850    }
    18441851  } catch { /* ignore */ }
    18451852  markBoosted(slug, id);
Note: See TracChangeset for help on using the changeset viewer.