Skip to content

feat: fakes model vote/save state#69

Merged
aeharding merged 1 commit into
mainfrom
feat/fake-vote-state
Jul 5, 2026
Merged

feat: fakes model vote/save state#69
aeharding merged 1 commit into
mainfrom
feat/fake-vote-state

Conversation

@aeharding

Copy link
Copy Markdown
Owner

Wave 2 of the provider-matrix follow-ups (~/threadiverse-plan.md).

Seed posts/comments now carry mutable myVote / saved / score (default unvoted, base score 1). Each fake derives these into its provider's wire shape — v1 post_actions/comment_actions, PieFed my_vote/saved/counts — and the like/save write 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.

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
aeharding merged commit f07b2ac into main Jul 5, 2026
1 check passed
@aeharding
aeharding deleted the feat/fake-vote-state branch July 5, 2026 23:49
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.
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