Skip to content

Fix issues found + improve e2e test coverage - #97

Merged
MV-GH merged 30 commits into
masterfrom
review-fixes
Nov 18, 2026
Merged

MV-GH merged 30 commits into
masterfrom
review-fixes

Conversation

@MV-GH

@MV-GH MV-GH commented Nov 18, 2026

Copy link
Copy Markdown
Owner

No description provided.

MV-GH added 17 commits November 18, 2026 09:50
Ktor's HttpRequestRetry default also retries any request method on
non-timeout exceptions. Overriding retryIf only covered 5xx responses,
so POST/PUT/DELETE could be resent after a connection drop and create
duplicate posts, comments or uploads.
constructBaseUrl only matched a bare "localhost", so "localhost:8536" and
"127.0.0.1:8536" were given https and failed to connect to a local dev server.
uploadAndApplyImage deletes the uploaded image when applying it fails, but on
cancellation the delete call itself was cancelled straight away, leaving an
orphaned image. Run the cleanup in NonCancellable.
Lemmy 1.0 lists invitations at GET /account/invite/list. /account/invite only
accepts POST (create) and DELETE (revoke), so listing always failed.

LocalUserInvite id and local_user_id are skip_serializing on the server, but the
js-client types mark them required, so creating and listing invitations failed
to deserialize. Drop both fields. Adds e2e tests for invitations.
The v1 PostView did not implement NotificationData, so a notification with
type_ "post" (new post in a followed community) failed to deserialize and made
the whole listNotifications call fail. Also fixed in the GenTypes sealed mapping
so regenerating keeps it.
FF.hidePost() is true on 1.x, but hidePosts returned notSupported because 1.0
has no bulk hide endpoint. Hide each post with hidePost instead, stopping at the
first failure.
The 0.18 transformer hard-coded admin = false, creator_is_admin = false and
is_admin = false, although 0.18 Person has an admin field. getMyUser, the site
admin list and every creator_is_admin reported nobody as admin.
0.18 sends timestamps without timezone and the transformer appends Z, but report
and custom emoji/tagline updated_at and RegistrationApplication.published_at
were passed through as is.
comment_reports was added twice and private message reports were left out. A
failed report request (non moderator) now gives null instead of 0, like 0.19.
Pre 1.0 editCustomEmoji overwrites every field. 0.18 threw a NPE on missing
fields (outside the Result) and 0.19 blanked them. Missing fields are now filled
with the emoji's current values.
enable_nsfw was removed in 1.0 and replaced by its inverse
nsfw_content_disallowed. The unified EditSite kept both, but pre 1.0 only
mapped enable_nsfw, so setting the new field had no effect on 0.18 and 0.19.
Drop enable_nsfw from EditSite and map nsfw_content_disallowed in every pre 1.0
version, like CreateSite already did.
All requests were sent before the first failure was returned, so an expired
token caused one failing request per post. Also send an empty auth instead of
the string "null" when logged out.
The x3 transformer dropped max_depth, so comment threads came back as flat
unlimited lists instead of depth limited trees.
The x3 transformer dropped it, so changes to the setting were ignored.
The x4 transformer dropped the post_id filter, so listReports returned post
reports for every post.
The x11 transformer left resolver null on comment reports, while every other
0.19 version maps it.
x6 and x11 hard-coded it to -1, although the server sends it.
@MV-GH
MV-GH enabled auto-merge (rebase) November 18, 2026 12:55
@MV-GH
MV-GH disabled auto-merge November 18, 2026 12:56
@MV-GH
MV-GH force-pushed the review-fixes branch 2 times, most recently from d8661a6 to f35b17c Compare November 18, 2026 15:20
Pre 1.0 Lemmy can't filter comment reports by post, 0.18 to 0.19.3 can't
filter post reports by post either, and private message reports belong to no
post or community. With post_id or community_id set, listReports returned
unrelated reports. Filter them on the client after the synthetic cursors are
set, so a page that is filtered down to nothing doesn't end the paging.

Private message reports with either filter return an empty page without
fetching, instead of paging through every report.
With max_depth set, pre 1.0 Lemmy ignores page and always returns the same
tree (limit 300, offset 0). The synthetic next cursor made clients that page
until next_page is null fetch the same comments forever.

Pages after the first return nothing and the tree has no prev_page either.
instanceBlock() was true on 0.19 while userBlockInstancePersons is v1 only, and
getModlog, listPersonRead, listPersonHidden and listPersonLiked had no flag.
Adds instanceBlockPersons(), modlog() and listPersonReadHiddenLiked(), with a
test that checks the flags against what each version wrapper supports.
Covers creating, listing and resolving post, comment, community and private
message reports, the combined report list, removing, locking and featuring
posts, removing comments, community and site bans, and the modlog entries for
these actions.
Lemmy 1.0 deletes custom emojis with DELETE /custom_emoji. lemmy-js-client still
declares POST /custom_emoji/delete, which the server doesn't have, so deleting
always failed with 404.
Lemmy 1.0 removed the leave admin endpoint (upstream PR 5970), but
lemmy-js-client still declares POST /admin/leave, so leaveAdmin always failed
with 404 on 1.0. Remove it from the unified API and every wrapper. Use
addAdmin with added = false instead.
Covers custom emojis, taglines, registration applications, adding and removing
admins, the admin user list, purging comments, posts, communities and persons,
and blocking and allowing instances.
Covers creating, reading by id and name, editing and deleting multi communities,
adding and removing communities, owner only changes, following, and listing by
creator and on the profile.
A runBlocking test whose last expression is assertNotNull returns a value, and
JUnit silently skips test methods that don't return void. Three tests never ran.
Lemmy sorts New and Old on published_at, but post ids don't always follow the
publish time, so asserting on sorted ids failed now and then.
Lemmy 1.0 has no community hide endpoint, PUT /community/hide only exists in
lemmy-js-client, so hideCommunity always failed on 1.0. In 1.0 a community is
hidden by setting its visibility to Unlisted. Remove hideCommunity and the
unified HideCommunity type.

Pre 1.0, creating or editing a community with Unlisted visibility now hides it
with the old endpoint, and Public (or LocalOnly where it exists) unhides it,
matching how hidden communities are already read as Unlisted. Hiding is admin
only there, so the admin check happens before anything is created or edited.
Public and Unlisted are now supported entries from 0.18.

If hiding a newly created community fails, the created community is still
returned (unhidden), so a retry doesn't fail with community_already_exists.
Lemmy 1.0 returns the resolved object itself (a ResolveObjectView), but the v1
controller decoded the response as a SearchResponse with required lists, so
every resolveObject call failed. The unified resolveObject now returns
ResolveObjectView like 1.0. Before 1.0 the first non-null object of the
ResolveObjectResponse is returned, or couldnt_find_object when it is empty.
@MV-GH
MV-GH enabled auto-merge (rebase) November 18, 2026 16:03
@MV-GH
MV-GH merged commit 444515a into master Nov 18, 2026
6 checks passed
@MV-GH
MV-GH deleted the review-fixes branch November 18, 2026 16:14
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