Changeset 8407e1e in Klonkt
- Timestamp:
- 08/10/2026 06:41:15 PM (4 weeks ago)
- Branches:
- main
- Children:
- be5a13c
- Parents:
- fc9ca9d
- File:
-
- 1 edited
-
src/routes/activitypub.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/routes/activitypub.js
rfc9ca9d r8407e1e 617 617 }); 618 618 619 // ── Long-poll (owner only, Robins verzoek 31-7) ─────────────────── 620 // Hold the request until something push-worthy lands for this account, then 621 // answer 200 (news: re-read your feed) or 204 after ~25s (nothing: re-arm). 622 // The thread in the app stays live without interval polling. 623 router.get('/ap/users/:slug/inbox/wait', (req, res) => { 624 const auth = OAuth.verifyBearer(req.headers.authorization); 625 if (!auth || auth.site.slug !== req.params.slug) return res.status(403).end(); 626 let settled = false; 627 const done = (code) => { 628 if (settled) return; 629 settled = true; 630 clearTimeout(timer); 631 off(); 632 if (!res.headersSent) res.status(code).end(); 633 }; 634 const off = AP.onNews(auth.site.slug, () => done(200)); 635 const timer = setTimeout(() => done(204), 25_000); 636 req.on('close', () => done(204)); 637 }); 638 639 // ── Blocked collection (owner only, AP §5.6) ────────────────────── 619 // De bel (/inbox/wait) is weg (shaer-pq4, 10-8). Hij deed hetzelfde als de 620 // WACHTENDE inbox-lezing hierboven, maar in twee rondjes in plaats van een: 621 // eerst 'er is nieuws', dan alsnog de lezing. Die lezing kan het zelf, en 622 // sinds ?changes=1 stuurt hij alleen nog het verschil. 623 // 624 // AP.onNews blijft bestaan: de Guardian-PWA hangt er ook aan. 625 640 626 // The server blocklist is the source of truth for Shaer's "in Orbit": 641 627 // clients read it here instead of keeping their own state. Actor-kind
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)