Changeset 0a686a0 in Klonkt


Ignore:
Timestamp:
07/25/2026 10:00:46 AM (7 weeks ago)
Author:
Robin <roboburr@…>
Branches:
main
Children:
787e0d9
Parents:
4f15f67
Message:

Fix: forward gated follow naar guardians op ANDERE instances (host-check)

De cross-instance forward vuurde nooit: slugFromActorUrl haalt de slug uit elk
/ap/users/<slug>-pad ongeacht de host, dus een guardian op een andere instance
werd als lokaal gezien -> push naar een niet-bestaande lokale slug, geen forward.
Nu is lokaal alleen waar de guardian op ONZE base staat EN er een lokale site
bestaat; anders wordt de Offer(Follow) geforward. Zo bereikt de goedkeuring de
guardians op andere servers.

Changed files:
src/services/ActivityPubService.js

  • gate: local-check op base + bestaande site i.p.v. kale slugFromActorUrl

remarks: npm test groen. Dit was waarom guardians op andere instances niks
binnenkregen.

-robo
Co-Authored-By: Claude Opus 4.8 <noreply@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/services/ActivityPubService.js

    r4f15f67 r0a686a0  
    14121412      const followObj = { id: followId, type: 'Follow', actor: who, object: wardActor };
    14131413      for (const g of wardGuardians) {
    1414         const gslug = slugFromActorUrl(g);
    1415         if (gslug) {
     1414        // Local ONLY when the guardian lives on THIS instance: slugFromActorUrl
     1415        // ignores the host (an /ap/users/x path on a remote host is someone
     1416        // else's actor), so also require our base + an existing local site.
     1417        const gslug = g.startsWith(`${base}/`) ? slugFromActorUrl(g) : null;
     1418        const isLocal = gslug && db.prepare('SELECT 1 FROM sites WHERE slug = ?').get(gslug);
     1419        if (isLocal) {
    14161420          const L = pushLang(gslug);
    14171421          pushEvent(gslug, { type: 'guardian', title: i18nT(L, 'push.n_guard_cog_t'), body: i18nT(L, 'push.n_guard_cog_b', { who: fi.name || fi.handle || i18nT(L, 'notif.someone') }), url: `${pushPrefix(gslug)}/guardian2` });
Note: See TracChangeset for help on using the changeset viewer.