| … | … | @@ -240,3 +240,20 @@ test('an observation feed is never scanned as an ordinary feed', async (t) => { |
| 240 | 240 | const n = await me.peer.notifications() |
| 241 | 241 | t.ok(n.every((x) => x.author !== gw.feed.key.toString('hex')), 'no row is attributed to the bridge feed itself') |
| 242 | 242 | }) |
| 243 | |
| 244 | // ⛔ A bsky actor is a DID, not a URL (hyper-social #82, I2): the same observation feed carries both networks, and a |
| 245 | // row says which one it came from so the surface can link the right place. |
| 246 | test('★ an observation whose actor is a DID is marked source:bsky', async (t) => { |
| 247 | const me = await mkPeer() |
| 248 | const gw = await gatewayFeed() |
| 249 | t.teardown(() => Promise.all([me.peer.close(), gw.feed.close()])) |
| 250 | await gw.feed.put(OBSERVATION, 'b1', obs('follow', { actor: 'did:plc:alicealicealice', activity: 'at://did:plc:alicealicealice/app.bsky.graph.follow/3x' })) |
| 251 | await gw.feed.put(OBSERVATION, 'f1', obs('follow')) |
| 252 | await gw.feed.update() |
| 253 | me.peer.feeds.set(Peer.nameFor(gw.feed.key), gw.feed) |
| 254 | me.peer.observers.set(gw.feed.key.toString('hex'), gw.root) |
| 255 | const rows = (await me.peer.notifications()).filter((x) => x.kind === 'follow') |
| 256 | const by = Object.fromEntries(rows.map((x) => [x.author, x.source])) |
| 257 | t.is(by['did:plc:alicealicealice'], 'bsky') |
| 258 | t.is(by['https://prsm.space/users/alice'], 'fediverse') |
| 259 | }) |