Changeset 8f8b40f in Klonkt
- Timestamp:
- 07/26/2026 07:26:03 AM (6 weeks ago)
- Branches:
- main
- Children:
- eb36688
- Parents:
- 97bacf2
- File:
-
- 1 edited
-
src/services/ActivityPubService.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/services/ActivityPubService.js
r97bacf2 r8f8b40f 2678 2678 // during a flux window, e.g. a fleet-wide update), and drops notes that are gone 2679 2679 // (404/410). Bump SELFHEAL_VERSION only on a release that warrants a re-sync. 2680 const SELFHEAL_VERSION = 7; // v7: rerun v6 with retry-until-clean semantics (origins briefly offline no longer stay stale forever)2680 const SELFHEAL_VERSION = 8; // v8: also re-capture FEP-9098 custom-emoji tags (emoji_json) onto already-cached posts 2681 2681 async function fetchNoteAP(url) { 2682 2682 try { … … 2859 2859 if (cur >= SELFHEAL_VERSION) return; // already healed for this version — skip on normal boots 2860 2860 let rows = []; 2861 try { rows = db.prepare('SELECT id, content, media_json, nsfw, cw, url FROM ap_timeline ORDER BY rowid DESC LIMIT 200').all(); } catch { /* no table */ }2861 try { rows = db.prepare('SELECT id, content, media_json, nsfw, cw, url, emoji_json FROM ap_timeline ORDER BY rowid DESC LIMIT 200').all(); } catch { /* no table */ } 2862 2862 let healed = 0, failed = 0; 2863 2863 for (const r of rows) { … … 2871 2871 const cw = note.summary || null; 2872 2872 const url = note.url || null; // re-sync the human url (catches a remote slug rename) 2873 if ((html && html !== r.content) || media !== (r.media_json || '[]') || nsfw !== (r.nsfw || 0) || (cw || '') !== (r.cw || '') || (url && url !== r.url)) { 2874 db.prepare('UPDATE ap_timeline SET content = ?, media_json = ?, nsfw = ?, cw = ?, url = COALESCE(?, url) WHERE id = ?').run(html || r.content, media, nsfw, cw, url, r.id); 2873 const emoji = extractEmojiTags(note.tag); // FEP-9098: re-capture custom-emoji tags (v8) 2874 if ((html && html !== r.content) || media !== (r.media_json || '[]') || nsfw !== (r.nsfw || 0) || (cw || '') !== (r.cw || '') || (url && url !== r.url) || (emoji || '') !== (r.emoji_json || '')) { 2875 db.prepare('UPDATE ap_timeline SET content = ?, media_json = ?, nsfw = ?, cw = ?, url = COALESCE(?, url), emoji_json = ? WHERE id = ?').run(html || r.content, media, nsfw, cw, url, emoji, r.id); 2875 2876 healed++; 2876 2877 }
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)