feat: fakes model vote/save state#69
Merged
Merged
Conversation
Seed posts/comments carry myVote/saved/score (default unvoted, base score 1), the fakes derive my_vote/saved/score into each provider's wire shape (v1 post_actions/comment_actions; piefed my_vote/saved/counts), and like/save writes mutate that state so the returned view and every subsequent read reflect it. Auth-gated; unvote returns to base score. Consumers can drop hand-built vote/save wire responses and assert resulting scores through the derived fake — the provider-matrix test now covers upvote → score/my_vote, unvote → base, and save on both providers.
aeharding
added a commit
that referenced
this pull request
Jul 6, 2026
Seed posts/comments gain a mutable `deleted` flag; the fakes derive createPost/createComment/editPost/editComment/deletePost/deleteComment — mutating the seed store (new entities appear in lists, edits change content, deletes set the flag) and returning the updated view. Comments created with parent_id nest via path. Auth-gated. Consumers can drop hand-built create/edit/delete wire responses and assert the rendered result through the derived fake. Provider-matrix test covers the full create→edit→delete cycle for posts and comments on both providers; also folds in the comment like/save coverage from #69.
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.
Wave 2 of the provider-matrix follow-ups (~/threadiverse-plan.md).
Seed
posts/commentsnow carry mutablemyVote/saved/score(default unvoted, base score 1). Each fake derives these into its provider's wire shape — v1post_actions/comment_actions, PieFedmy_vote/saved/counts— and thelike/savewrite routes mutate the seed state, so the returned view and every subsequent read reflect it. Auth-gated; unvote returns to base score.Vote math: base score is treated as upvotes; the logged-in user's vote layers on top (base 1 → upvote → score 2 / upvotes 2; downvote → score 0).
Unlocks: consumers can stop hand-building vote/save wire responses (Voyager's gestures + feed-interactions specs) and assert resulting scores through the derived fake. Provider-matrix test covers upvote →
my_vote/score, unvote → base, and save, on both lemmyv1 and piefed.435 tests, typecheck, lint, build clean.