fed-sx-m2: Step 9b — outbox ?since=Cid pagination + 3 tests
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 19s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 19s
actor_outbox_response_for/3 in http_server.erl now reads ?since=
from the query string before paging:
Q = field(request_query, Cfg),
Filtered = case parse_since(Q) of
nil -> Entries;
SinceCid -> backfill:since_cid_entries(SinceCid, Entries)
end,
Slice = page_slice(Filtered, Page),
...
New helpers:
parse_since/1 — scan query for since=<Cid>, value is the
binary up to next & or end-of-binary. nil
when absent.
scan_param/2,3 — generic 'find Name=Value anywhere in &-sep
query'. Used for since= today; could be
factored over parse_page=.
skip_to_amp/1 — walk past the next & for the iteration step.
Order-independent: ?since=X&page=2 and ?page=2&since=X both
work. Unknown cid -> backfill:since_cid_entries returns []
-> empty page -> body degrades to tip-only shape (Step 4d
back-compat).
Three new cases in http_multi_actor.sh (44/44 total):
- ?since=<first cid> filters out the first publish, leaving
2 of 3 items in the paged response
- ?since=<unknown cid> -> empty page; body has tip but no
item: lines (tip-only degrade)
- ?since=<cid> + ?page=1 combined — pagination still applies
to the filtered list
Latent issue surfaced + fixed in passing: http_multi_actor.sh
was missing follower_graph + delivery + backfill module loads
(outbox has depended on follower_graph + delivery since Step 7c
and now backfill from 9a). Added all three with epoch 100/101/
102 to match the c6b49200 fix-up pattern. 41 existing tests now
also exercise the live path through outbox:publish without
crashing on missing module deps.
This commit is contained in:
@@ -651,10 +651,21 @@ Per §13.3: A wants B's history when A first follows B. Four modes:
|
||||
cases: N=0, N>length, T=0, since_cid hit/miss/unknown),
|
||||
wrap_backfill, parse_mode atoms / tuples / proplists /
|
||||
unknown.
|
||||
- [ ] **9b** — `GET /actors/<id>/outbox?since=Cid&limit=N`
|
||||
pagination route. Extends the Step 4d outbox listing with
|
||||
the `?since=` query param (calls `backfill:since_cid_entries/2`).
|
||||
Acceptance test extends `http_multi_actor.sh`.
|
||||
- [x] **9b** — `GET /actors/<id>/outbox?since=Cid` pagination
|
||||
route. The Step 4d outbox handler in `http_server.erl`
|
||||
(`actor_outbox_response_for/3`) now reads `?since=` from the
|
||||
query string via new `parse_since/1` + `scan_param/2,3` +
|
||||
`skip_to_amp/1` (handles `since=X&page=2` and `page=2&since=X`
|
||||
identically), pre-filters entries via
|
||||
`backfill:since_cid_entries/2`, then runs the existing page
|
||||
slice on the filtered list. `?since=unknown` → empty page →
|
||||
body degrades to the tip-only shape (Step 4d back-compat).
|
||||
3 new cases in `http_multi_actor.sh` (44/44 total) — exercise
|
||||
filtering, unknown-cid, combined `?since= + ?page=`. Also
|
||||
added `follower_graph` + `delivery` + `backfill` module loads
|
||||
to `http_multi_actor.sh` (downstream dependency since Step
|
||||
7c/9a — must have been latently broken; the existing 41
|
||||
passes + 3 new = 44 now all green).
|
||||
- [ ] **9c** — Follow → Accept → backfill-delivery wiring.
|
||||
The receiving kernel reads the Follow's `:backfill` field
|
||||
via `parse_mode/1`, slices its outbox, and dispatches each
|
||||
@@ -1036,6 +1047,19 @@ proceed.
|
||||
|
||||
Newest first.
|
||||
|
||||
- **2026-06-07** — Step 9b: outbox `?since=Cid` pagination.
|
||||
`actor_outbox_response_for/3` in `http_server.erl` now reads
|
||||
`?since=` from the query string via new `parse_since/1` +
|
||||
`scan_param/2,3` + `skip_to_amp/1` (works whether the param
|
||||
is first or after `&`), pre-filters entries through
|
||||
`backfill:since_cid_entries/2`, then runs the existing page
|
||||
slice on the filtered list. Unknown cid -> empty page -> tip-
|
||||
only degrade. Three new cases in `http_multi_actor.sh` (44/44
|
||||
total) cover filter, unknown-cid, combined since+page.
|
||||
Latent issue surfaced + fixed in passing: the test was missing
|
||||
`follower_graph` + `delivery` + `backfill` module loads
|
||||
(since Step 7c made outbox depend on them); added all three.
|
||||
|
||||
- **2026-06-07** — Step 9a: pure-functional backfill slicing.
|
||||
`next/kernel/backfill.erl` with `slice/2,3(Mode, LogState
|
||||
[, Wrap])` returning the appropriate activity list. Modes
|
||||
|
||||
Reference in New Issue
Block a user