Repository navigation
Fix issues found + improve e2e test coverage - #97
Merged
Merged
Conversation
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
enabled auto-merge (rebase)
November 18, 2026 12:55
MV-GH
disabled auto-merge
November 18, 2026 12:56
MV-GH
force-pushed
the
review-fixes
branch
2 times, most recently
from
November 18, 2026 15:20
d8661a6 to
f35b17c
Compare
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.
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.
No description provided.