WIP! A BB-style forum, on the ATmosphere!
We're still working... we'll be back soon when we have something to show off!
node
typescript
hono
htmx
atproto
1meta {
2 name: Trigger Backfill
3 type: http
4 seq: 1
5}
6
7post {
8 url: {{appview_url}}/api/admin/backfill
9}
10
11params:query {
12 ~force: full_sync
13}
14
15headers {
16 Content-Type: application/json
17}
18
19assert {
20 res.status: in [200, 202]
21 res.body.message: isDefined
22}
23
24docs {
25 Triggers a backfill of AT Protocol repo records for all known forum members.
26 Runs asynchronously — returns immediately with 202 Accepted or 200 (if not needed).
27
28 Requires authentication via session cookie and `space.atbb.permission.manageForum` permission.
29
30 Query params:
31 - force: string (optional) - Override automatic gap detection. One of:
32 - "catch_up" — Replay firehose events since last cursor (missed events only)
33 - "full_sync" — Re-sync every member's full repo from scratch
34
35 When `force` is omitted, the endpoint runs automatic gap detection:
36 - If cursor is older than backfillCursorMaxAgeHours, triggers CatchUp
37 - If no cursor exists at all, triggers FullSync
38 - If cursor is recent and healthy, returns 200 with "No backfill needed" message
39
40 Returns (202 — backfill started):
41 {
42 "message": "Backfill started",
43 "type": "catch_up" | "full_sync",
44 "status": "in_progress",
45 "id": "42" // bigint as string — use with GET /api/admin/backfill/:id to poll progress
46 }
47
48 Returns (200 — no backfill needed):
49 {
50 "message": "No backfill needed. Use ?force=catch_up or ?force=full_sync to override."
51 }
52
53 Error codes:
54 - 401: Unauthorized (not authenticated)
55 - 403: Forbidden (lacks manageForum permission)
56 - 409: Conflict — a backfill is already in progress
57 - 503: BackfillManager not available (server configuration issue)
58
59 Error codes (additional):
60 - 500: Failed to check backfill status or create progress row (server error)
61
62 Notes:
63 - The backfill ID in the 202 response can be used immediately with GET /api/admin/backfill/:id
64 - Unrecognized values for ?force are ignored and fall through to automatic gap detection
65}