Ignore:
Timestamp:
08/21/2026 08:44:47 AM (3 weeks ago)
Author:
Robin <roboburr@…>
Branches:
main
Children:
4e5fe29
Parents:
bb9e54c
Message:

A block now leaves the house: Block out, Undo(Block) back

Blocking was purely local — row in ap_blocks, purge the cached content,
drop the follower — and the other side never heard about it. The hub
kept the channel and every post, because nothing told it and its
unsigned crawl kept reading the public outbox (seen on dev.klonkt.com,
21-8).

Now blocking delivers a Block to the blocked actor's inbox and
unblocking an Undo(Block), so the way back stays open. Delivery can
never hold up the block itself: the row is written first and a
failed delivery is swallowed. Domain blocks send nothing — no inbox to
address.

Second door: a signed reader we block gets the same 404 on /ap/notes/:id
that a stranger gets, matching what the outbox already did. Unsigned
callers stay anonymous to us and keep the public view; that is what the
Block delivery is for.

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/services/ActivityPubService.js

    rbb9e54c re311202  
    36003600        if (innerType === 'Block') {
    36013601          if (!innerTarget) return { status: 400, error: 'missing_object' };
    3602           unblock(site, innerTarget);   // release from Orbit
     3602          unblock(site, innerTarget).catch(() => {});   // release from Orbit
    36033603          return { status: 202, url: innerTarget };
    36043604        }
     
    66666666// Block an actor (@handle or actor URL) or a whole domain; purges their content.
    66676667// The handle resolver is ours; the storage/purge lives in BlocklistService.
    6668 export async function blockTarget(site, input) { return Blocklist.blockTarget(site, input, webfingerResolve); }
    6669 
    6670 export function unblock(site, target) { return Blocklist.unblock(site, target); }
     6668//
     6669// De BEZORGING hoort ook hier: BlocklistService kent de database, niet het
     6670// afleveren. Een Block gaat naar de inbox van wie je blokkeert, een
     6671// Undo(Block) bij het opheffen -- zonder retry-wachtrij, want een blokkade
     6672// wacht niet op een server die even plat ligt (en bij opheffen komt de ander
     6673// vanzelf weer langs).
     6674async function bezorgBlokkade(site, target, undo) {
     6675  const base = (process.env.PUBLIC_BASE_URL || '').replace(/\/+$/, '');
     6676  const me = actorId(base, site.slug);
     6677  const blok = { id: `${me}#block-${Date.now()}-${rid()}`, type: 'Block', actor: me, object: target, to: [target] };
     6678  const activiteit = undo
     6679    ? { '@context': AP_CONTEXT, id: `${me}#unblock-${Date.now()}-${rid()}`, type: 'Undo', actor: me, object: blok, to: [target] }
     6680    : { '@context': AP_CONTEXT, ...blok };
     6681  const r = await deliverToActor(site, target, activiteit);
     6682  console.log('[AP]', undo ? 'Undo(Block)' : 'Block', site.slug, '→', target, r && r.delivered ? 'bezorgd' : 'niet bezorgd');
     6683}
     6684
     6685export async function blockTarget(site, input) { return Blocklist.blockTarget(site, input, webfingerResolve, bezorgBlokkade); }
     6686
     6687export function unblock(site, target) { return Blocklist.unblock(site, target, bezorgBlokkade); }
    66716688
    66726689// ── Guardianship module wiring (src/services/guardianship/) ────────
Note: See TracChangeset for help on using the changeset viewer.