Changeset d5aa7c8 in Klonkt


Ignore:
Timestamp:
06/30/2026 01:24:56 PM (2 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
462a931
Parents:
61514f2
Message:

fix(federation): clear ap_my_reactions when a boosted/liked remote post is deleted

The inbound Delete handler cleaned ap_interactions + ap_timeline but not ap_my_reactions, so a
boost/like you made of a remote post (via the interact page) stayed stuck as "boosted" after
that post was deleted upstream. Now also remove the ap_my_reactions record, host-scoped so a
remote actor can only clear reactions to its OWN domain's notes.

  • src/services/ActivityPubService.js — Delete handler clears ap_my_reactions (host-guarded)

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/services/ActivityPubService.js

    r61514f2 rd5aa7c8  
    881881      try { db.prepare('DELETE FROM ap_interactions WHERE object_uri = ? AND actor_uri = ?').run(oid, claimedActor); } catch { /* ignore */ }
    882882      try { db.prepare('DELETE FROM ap_timeline WHERE id = ? AND author_uri = ?').run(oid, claimedActor); } catch { /* ignore */ }
     883      // Also clear a boost/like YOU made of this now-deleted remote post (the interact-page
     884      // ap_my_reactions state), so it can't stay stuck as "boosted" on a post that's gone.
     885      // Guard: only when the deleter owns the note's domain (B mustn't clear your reactions
     886      // to A's posts).
     887      try {
     888        let sameHost = false;
     889        try { sameHost = new URL(oid).host === new URL(claimedActor).host; } catch { sameHost = false; }
     890        if (sameHost) db.prepare('DELETE FROM ap_my_reactions WHERE target_uri = ?').run(oid);
     891      } catch { /* ignore */ }
    883892    }
    884893    return 202;
Note: See TracChangeset for help on using the changeset viewer.