Changeset 9e4e4ff in Klonkt
- Timestamp:
- 06/27/2026 08:17:34 AM (2 months ago)
- Branches:
- main
- Children:
- cb95343
- Parents:
- c21197a
- File:
-
- 1 edited
-
src/services/ActivityPubService.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/services/ActivityPubService.js
rc21197a r9e4e4ff 1174 1174 // during a flux window, e.g. a fleet-wide update), and drops notes that are gone 1175 1175 // (404/410). Bump SELFHEAL_VERSION only on a release that warrants a re-sync. 1176 const SELFHEAL_VERSION = 1;1176 const SELFHEAL_VERSION = 2; 1177 1177 async function fetchNoteAP(url) { 1178 1178 try { … … 1200 1200 if (cur >= SELFHEAL_VERSION) return; // already healed for this version — skip on normal boots 1201 1201 let rows = []; 1202 try { rows = db.prepare('SELECT id, content, media_json FROM ap_timeline ORDER BY rowid DESC LIMIT 200').all(); } catch { /* no table */ }1202 try { rows = db.prepare('SELECT id, content, media_json, nsfw, cw FROM ap_timeline ORDER BY rowid DESC LIMIT 200').all(); } catch { /* no table */ } 1203 1203 let healed = 0; 1204 1204 for (const r of rows) { … … 1209 1209 const html = HtmlSanitizerService.sanitize(note.content || ''); 1210 1210 const media = mediaFromNote(note); 1211 if ((html && html !== r.content) || media !== (r.media_json || '[]')) { 1212 db.prepare('UPDATE ap_timeline SET content = ?, media_json = ? WHERE id = ?').run(html || r.content, media, r.id); 1211 const nsfw = note.sensitive ? 1 : 0; // re-sync NSFW/sensitive + CW onto already-cached posts 1212 const cw = note.summary || null; 1213 if ((html && html !== r.content) || media !== (r.media_json || '[]') || nsfw !== (r.nsfw || 0) || (cw || '') !== (r.cw || '')) { 1214 db.prepare('UPDATE ap_timeline SET content = ?, media_json = ?, nsfw = ?, cw = ? WHERE id = ?').run(html || r.content, media, nsfw, cw, r.id); 1213 1215 healed++; 1214 1216 }
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)