Skip to content

feat: fakes paginate, honor max_depth, and derive search - #71

Merged
aeharding merged 2 commits into
mainfrom
fakes-pagination-search
Jul 25, 2026
Merged

feat: fakes paginate, honor max_depth, and derive search#71
aeharding merged 2 commits into
mainfrom
fakes-pagination-search

Conversation

@aeharding

Copy link
Copy Markdown
Owner

Closes the last three fake-capability gaps that keep consumer specs pinned to a single provider.

Pagination. Derived lists page with each software's real model — Lemmy v1 hands out opaque page_cursor strings it round-trips, PieFed uses 1-based page numbers — across posts, comments, person content, and the notification fan-outs. Consumers exercise their actual infinite-scroll code instead of hand-built page responders.

max_depth. Comment lists honor it, relative to parent_id when present (fetching a subtree returns that comment plus N levels beneath it). This is what makes "N more replies" testable from seeds: the deep reply stays out of the initial load, so child_count − loaded is non-zero.

Search. Derived from seeded content on both fakes — term matches post title/body, comment content, community name/title, person name; type_ filters buckets — rendered into each software's search wire shape (v1's {comments, posts, communities, persons}, PieFed's {type_, communities, posts, users, comments}).

Matrix tests cover all three on both providers, including feeding a returned cursor back in and asserting depth relative to a parent. 443 tests, live fidelity suite still 9/9.

One follow-up for the consumer side: search now has a derived default, so it's no longer the "unmocked endpoint" example in the round-trip test (resolveObject took over).

- derived lists paginate with each software's real model (v1 opaque
  page_cursor strings it round-trips; piefed 1-based page numbers) across
  posts, comments, person content, and the notification fan-outs
- comment lists honor max_depth, relative to parent_id when present — so
  a seeded deep reply stays out of the initial load, which is what makes
  'N more replies' affordances testable
- search derives from seeded content on both fakes (term matches title/
  body/content/name, type_ filters buckets), rendered into each
  software's search wire shape

Consumers can now drive infinite scroll, comment-tree expansion, and
search from seeds alone — the last capability gaps keeping consumer
specs pinned to a single provider.
Review findings, all confirmed against live servers:

- lists hand out a cursor whenever they filled the page (real Lemmy's
  rule), so the last full page is followed by an empty one instead of the
  fake stopping a page early
- a degenerate limit can no longer emit a cursor that fails to advance
  (a consumer paging loop could have spun forever), and page numbers
  clamp to >= 1
- piefed counts max_depth from top-level when no parent_id is given,
  where lemmy counts from the post — the fake now matches each
- child_count derives from seeded descendants, so seeding a deep reply
  gives its ancestors a real count. Without this, max_depth hid the
  reply but 'N more replies' still couldn't render — the affordance this
  work exists to enable
@aeharding
aeharding merged commit 0df95ed into main Jul 25, 2026
1 check passed
@aeharding
aeharding deleted the fakes-pagination-search branch July 25, 2026 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant