Changeset 4e5fe29 in Klonkt for test


Ignore:
Timestamp:
08/21/2026 08:58:20 AM (3 weeks ago)
Author:
Robin <roboburr@…>
Branches:
main
Children:
8ed36de
Parents:
e311202
Message:

Tell an ex-follower they are one: Reject(Follow) on removal

Removing a follower was silent, so the other side kept us in its books
as a live relationship while nothing was ever delivered again — the hub
sat there 'following' dev.klonkt.com for days. Reject(Follow) is the
standard signal for exactly this, and the removal itself never waits on
it: the row is gone first, the notice is a courtesy that may fail.

Blocking already carries the stronger Block signal, so this covers the
other door: the owner removing someone by hand.

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/block-federeert.test.js

    re311202 r4e5fe29  
    7676  assert.equal(db.prepare('SELECT count(*) c FROM ap_blocks WHERE target = ?').get('https://203.0.113.99/ap/actor').c, 1);
    7777});
     78
     79test('een verwijderde volger krijgt een Reject(Follow)', async () => {
     80  bezorgd.length = 0;
     81  const VOLGER = 'https://203.0.113.81/ap/actor';
     82  db.prepare(`INSERT INTO ap_followers (slug, actor_uri, inbox, created_at)
     83              VALUES ('dev', ?, ?, CURRENT_TIMESTAMP)`).run(VOLGER, `${VOLGER}/inbox`);
     84  const rij = db.prepare('SELECT id FROM ap_followers WHERE actor_uri = ?').get(VOLGER);
     85  assert.equal(AP.removeFollower('dev', rij.id), true);
     86  await new Promise((r) => setTimeout(r, 150));   // bezorging is fire-and-forget
     87  const rej = bezorgd.find((b) => b.activiteit.type === 'Reject');
     88  assert.ok(rej, 'er is een Reject bezorgd');
     89  assert.equal(rej.activiteit.object.type, 'Follow');
     90  assert.equal(rej.activiteit.object.actor, VOLGER, 'het gaat om ZIJN follow op ons');
     91  assert.equal(db.prepare('SELECT count(*) c FROM ap_followers WHERE actor_uri = ?').get(VOLGER).c, 0);
     92});
Note: See TracChangeset for help on using the changeset viewer.