Claude/project analysis improvements or2 b9#7
Conversation
…ry logic, and fix thread safety - Add ErrorKind: KindNotFound (404), KindConflict (409), KindPayloadTooLarge (413) - Add sentinel errors: ErrBadRequest, ErrNotFound, ErrConflict, ErrPayloadTooLarge - Fix Unwrap() for KindBadRequest and KindNetwork to enable errors.Is() checks - Add parseRetryAfter support for RFC 1123 HTTP-date format - Add SuggestButtons, InlineSuggestButton, Directive, BotRequest, ServerAction types - Add BotRequest field to Update for interactive button callbacks - Add missing API parameters: PayloadID, DisableNotification, DisableWebPagePreview, ThreadID, SuggestButtons to sendText; Text and SuggestButtons to sendGallery; SuggestButtons to sendFile, sendImage, createPoll - Consolidate retry logic into Client.DoMultipartRequest, removing duplicate implementations from files and messages services (fixes zero-sleep bug) - Make FakeDoer thread-safe with sync.Mutex - Add jitter to PollLoop to prevent thundering herd - Add filename sanitization for Content-Disposition headers - Add gallery image count upper bound validation - Add comprehensive tests for SendImage, SendGallery, GetFile, GetVotersPage, DoMultipartRequest, HTTPLogger, and FakeDoer concurrency - Update Image type to match API spec (file_id, size, name fields) - Add godoc for config fields, HttpDoer thread-safety, DoRequest body closing https://claude.ai/code/session_012wWqCdE6SPWAXSxdf9ic78
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d8247c9bd2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
|
|
||
| return parsed.Message, nil | ||
| return &ym.Message{ID: parsed.MessageID}, nil |
There was a problem hiding this comment.
Validate message_id before returning sendText success
This returns success even when message_id is absent/zero, so a payload like {"ok":true} (or a legacy message envelope without top-level message_id) yields &ym.Message{ID:0}. That silently propagates an invalid identifier into follow-up flows (reply/delete) instead of surfacing a protocol error, whereas the previous implementation rejected missing message data.
Useful? React with 👍 / 👎.
| var parsed struct { | ||
| OK bool `json:"ok"` | ||
| MessageID ym.MessageID `json:"message_id"` | ||
| } |
There was a problem hiding this comment.
Parse
message envelope in multipart success responses
The multipart success parser now accepts only top-level message_id, so responses shaped as {ok:true, message:{...}} are treated as failures (message_id missing). That is a regression for endpoints that still return a message object (the same /bot/v1/messages/sendFile response shape is still expected in client/ym/files/service.go), causing successful SendFile/SendImage/SendGallery calls to fail.
Useful? React with 👍 / 👎.
No description provided.