Repository navigation
Fix: Accept latest as the ID in the release and thumbnail endpoints - #768
Merged
axllent merged 1 commit intoNov 6, 2026
Merged
Conversation
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.
Summary
The API docs say
POST /api/v1/message/{ID}/releaseandGET /api/v1/message/{ID}/part/{PartID}/thumbacceptlatestas the ID, but release returns 404 and thumb returns 400 (sql: no rows in result set). The same requests with the real message ID work, and the other endpoints that documentlatest(message, headers, part, raw, html-check, link-check, SpamAssassin, Rspamd) accept it.To reproduce on develop (8e7a084), with a relay configured and one message that has an image attachment as part 2:
This adds the same
storage.LatestID(r)lookup thatDownloadAttachmentgot in the fix for #437, with the same 404 response when there are no messages.POST /api/v1/message/latest/release404 page not foundGET /api/v1/message/latest/part/2/thumbsql: no rows in result setimage/jpegRelated issues
Refs #437, which fixed the same problem for
part/{PartID}only.Type of change
Test plan
TestThumbnailLatesttoserver/apiv1/thumbnail_test.go. On the parent commit it fails withstatus=400, want 200; body="sql: no rows in result set".latestnow relays the newest message, the same as its real ID.go test ./...,go vet ./server/...,gofmtandgolangci-lint run ./server/...(v2.15.0) pass.AI assistance disclosure
Please indicate whether AI tools (e.g. Claude, Copilot, ChatGPT, Cursor) were used in preparing this pull request:
If AI was used, briefly describe how (which tools, and for what parts):
Claude Code Opus5.5 drafted the handler changes and the test. I reviewed the diff, checked that it matches the existing
latesthandling inDownloadAttachment, and re-ran the tests and the curl requests above.Checklist