Changeset 5924bbf in Klonkt
- Timestamp:
- 06/30/2026 01:42:44 PM (2 months ago)
- Branches:
- main
- Children:
- 2306abd
- Parents:
- d8e3ff7
- File:
-
- 1 edited
-
src/services/ActivityPubService.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/services/ActivityPubService.js
rd8e3ff7 r5924bbf 1500 1500 // during a flux window, e.g. a fleet-wide update), and drops notes that are gone 1501 1501 // (404/410). Bump SELFHEAL_VERSION only on a release that warrants a re-sync. 1502 const SELFHEAL_VERSION = 3;1502 const SELFHEAL_VERSION = 4; 1503 1503 async function fetchNoteAP(url) { 1504 1504 try { … … 1572 1572 if (cur >= SELFHEAL_VERSION) return; // already healed for this version — skip on normal boots 1573 1573 let rows = []; 1574 try { rows = db.prepare('SELECT id, content, media_json, nsfw, cw FROM ap_timeline ORDER BY rowid DESC LIMIT 200').all(); } catch { /* no table */ }1574 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 */ } 1575 1575 let healed = 0; 1576 1576 for (const r of rows) { … … 1583 1583 const nsfw = note.sensitive ? 1 : 0; // re-sync NSFW/sensitive + CW onto already-cached posts 1584 1584 const cw = note.summary || null; 1585 if ((html && html !== r.content) || media !== (r.media_json || '[]') || nsfw !== (r.nsfw || 0) || (cw || '') !== (r.cw || '')) { 1586 db.prepare('UPDATE ap_timeline SET content = ?, media_json = ?, nsfw = ?, cw = ? WHERE id = ?').run(html || r.content, media, nsfw, cw, r.id); 1585 const url = note.url || null; // re-sync the human url (catches a remote slug rename) 1586 if ((html && html !== r.content) || media !== (r.media_json || '[]') || nsfw !== (r.nsfw || 0) || (cw || '') !== (r.cw || '') || (url && url !== r.url)) { 1587 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); 1587 1588 healed++; 1588 1589 }
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)