Changeset 3f32994 in Klonkt
- Timestamp:
- 07/28/2026 08:47:48 AM (6 weeks ago)
- Branches:
- main
- Children:
- b1512e0
- Parents:
- c52dc82
- File:
-
- 1 edited
-
src/services/ActivityPubService.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/services/ActivityPubService.js
rc52dc82 r3f32994 2849 2849 // during a flux window, e.g. a fleet-wide update), and drops notes that are gone 2850 2850 // (404/410). Bump SELFHEAL_VERSION only on a release that warrants a re-sync. 2851 const SELFHEAL_VERSION = 1 7; // v17: re-resolve link previews now that OpenGraph works and big pages are read instead of refused2851 const SELFHEAL_VERSION = 18; // v18: link previews no longer hang behind the note re-fetch (an unreachable origin skipped the whole row) 2852 2852 async function fetchNoteAP(url) { 2853 2853 try { … … 3162 3162 let healed = 0, failed = 0; 3163 3163 for (const r of rows) { 3164 // Link previews first, and deliberately BEFORE the note re-fetch. A 3165 // preview is resolved from the content we already hold, so hanging it 3166 // behind a remote fetch meant one unreachable origin skipped the whole 3167 // row (`continue` below) and the card never appeared. It needs nothing 3168 // from the origin, so it must not depend on it. 3169 if (!r.quote_json && !r.embed_json) { 3170 try { 3171 const ej = await resolveExternalEmbed(r.content); 3172 if (ej) db.prepare('UPDATE ap_timeline SET embed_json = ? WHERE id = ?').run(ej, r.id); 3173 } catch { /* best-effort, never blocks the heal */ } 3174 } 3164 3175 try { 3165 3176 const note = await fetchNoteAP(r.id); … … 3185 3196 const ai = actorInfo(await fetchActor(r.author_uri), r.author_uri); 3186 3197 if (ai.emojis) { try { db.prepare('UPDATE ap_timeline SET author_emoji_json = ? WHERE id = ?').run(JSON.stringify(ai.emojis), r.id); } catch { /* ignore */ } } 3187 }3188 // v16: link previews. A post from before the embed pipeline has no3189 // card at all, which is why nothing showed. Only for rows that have no3190 // quote (a quote already IS the card) and no embed yet, so this costs3191 // one page fetch per candidate and never repeats.3192 if (!r.quote_json) {3193 const ej = await resolveExternalEmbed(html || r.content).catch(() => null);3194 if (ej) { try { db.prepare('UPDATE ap_timeline SET embed_json = ? WHERE id = ?').run(ej, r.id); } catch { /* ignore */ } }3195 3198 } 3196 3199 // v14: same for the booster's display name ("X boosted"). The row stores
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)