Skip to content

fix(lemmyv0,piefed): listPersonContent now honors caller-supplied sort#38

Merged
aeharding merged 1 commit into
mainfrom
fix-listpersoncontent-sort
May 23, 2026
Merged

fix(lemmyv0,piefed): listPersonContent now honors caller-supplied sort#38
aeharding merged 1 commit into
mainfrom
fix-listpersoncontent-sort

Conversation

@aeharding
Copy link
Copy Markdown
Owner

Summary

listPersonContent in the lemmyv0 and piefed adapters was hardcoding sort: "New" after spreading the caller's payload, so any sort the caller passed was silently clobbered. v1 was already correct.

-  { ...compat.fromPageParams(payload), sort: "New" }
+  { sort: "New", ...compat.fromPageParams(payload) }

Default behavior preserved (still falls back to "New" when caller omits sort); caller's choice now wins.

How it slipped through: the original "fix: sort by new for listPersonContent" (c12912f, Dec 2025) was a one-line change with no test, and no downstream caller validated the wire shape.

Test plan

Adds test/listPersonContent-sort.test.ts — 4 cases covering both providers:

  • v0: caller's sort: "Hot" reaches getPersonDetails wire as sort=Hot
  • v0: caller omits sort → wire is sort=New
  • piefed: caller's sort: "TopWeek" reaches /post/list
  • piefed: caller's sort: "Hot" reaches /comment/list

Verified the new tests fail against main (without the fix) and pass with it. All 23 tests pass overall.

@aeharding aeharding merged commit 11e5a09 into main May 23, 2026
1 check passed
@aeharding aeharding deleted the fix-listpersoncontent-sort branch May 23, 2026 16:24
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