feat: fakes paginate, honor max_depth, and derive search - #71
Merged
Conversation
- 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_cursorstrings it round-trips, PieFed uses 1-basedpagenumbers — 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 toparent_idwhen 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, sochild_count − loadedis 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:
searchnow has a derived default, so it's no longer the "unmocked endpoint" example in the round-trip test (resolveObjecttook over).