Repository navigation
release: v0.7.0-alpha — align library with MAX Bot API and fix reported issues - #39
Merged
Merged
Conversation
…ed issues Review of the whole library against the MAX Bot API schemas (official Go SDK) plus fixes for all open issues. Fixes: - #34 AnswerCallbackQueryAsync sends callback_id; NewMessageBody uses AttachmentRequest[]/NewMessageLink - #38 FileUploadResult exposes Photos/FileId again, Token is filled from photos, XML CDN responses are not treated as tokens; new IFilesApi.UploadAsync helper - #22 flat {"code","message"} errors are parsed; MaxAttachmentNotReadyException; only attachment.not.ready is retried (send + edit) - #23 GetChatsAsync parses {"chats","marker"}; GetChatListAsync for pagination - #35 WebhookController is abstract (no implicit endpoint); app.MapMaxWebhook() - #36 ConfigureWebhookAsync/DeleteWebhookAsync fall back to Webhook.Endpoint/SecretToken - #37 Update.ChatId/Chat/ChatType filled from message.recipient - #15 AttachmentRequest factories (ImageFromUrl, Image, Video, File, Location, ...) - #18 #20 #21 #25 #16 regression tests and richer attachment/update models - Polling marker comes from the response (MAX updates have no update_id) - Default webhook secret header is X-Max-Bot-Api-Secret - GetPinnedMessageAsync parses {"message"}; AddChatAdminRequest sends {"admins":[...]} - Lenient enums for chat status / admin permissions, real User-Agent version - Upload retries rewind the stream - Bump Microsoft.SourceLink.GitHub to 10.0.401 (NU1902 broke restore) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JWng6Vbuo8rweWS5x8PX56
- Format ids and numeric query values with InvariantCulture (U+2212 minus broke negative group chat ids on sv-SE/nb-NO/fi-FI hosts) - Webhook: controller and MapMaxWebhook share one pipeline that checks size and secret before reading/parsing the body; no fallback to unconfigured IOptions<MaxBotOptions> (it disabled the secret check); Webhook.HandlerTimeout is applied; secret format validated; ConfigureWebhookAsync only updates options on success and always stores an explicit secret - Polling: tolerant batch parsing skips poison updates instead of looping forever; marker advances only after the whole batch; StopAsync waits for parallel handlers; AllowedUsernames uses the callback presser - Attachments with unexpected field types no longer break deserialization - attachment.not.ready is retried by SendMessageAsync(SendMessageRequest) too - Uploads: non-seekable streams are buffered for retries; derived photo token is not serialized next to photos; resumable video/audio upload skips trailing GET - Retry-After in the past no longer throws; Update.Chat/ChatId setters clear inference flags; message_chat_created exposes ChatId - GetChatMembersPageAsync returns the marker; open_app/clipboard buttons; ChatType from is_channel; AddChatAdminRequest.UserId marked obsolete - CHANGELOG/README accuracy fixes Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JWng6Vbuo8rweWS5x8PX56
1 of 3 tasks
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
Review of the whole library against the MAX Bot API (schemas of the official Go SDK
max-bot-api-client-go) and fixes for all open issues. Version bumped to 0.7.0-alpha (contains breaking changes, see CHANGELOG).Issues
AnswerCallbackQueryAsyncsendscallback_id;NewMessageBodyusesAttachmentRequest[]/NewMessageLinkFileUploadResult.Photos/FileIdrestored,Tokenfilled fromphotos; XML CDN response is not a token; newIFilesApi.UploadAsync{"code","message"}errors parsed;MaxAttachmentNotReadyException; onlyattachment.not.readyis retried (send + edit)GetChatsAsyncparses{"chats","marker"};GetChatListAsync(count, marker)WebhookControlleris abstract (no implicit endpoint in every ASP.NET app);app.MapMaxWebhook()ConfigureWebhookAsync()/DeleteWebhookAsync()fall back toWebhook.Endpoint/SecretTokenUpdate.ChatId/Chat/ChatTypefrommessage.recipient(andis_channel)AttachmentRequestfactories (ImageFromUrl,Image,Video,Audio,File,FromUpload,Sticker,Contact,Location,Share,Keyboard)Other API mismatches found during review
update_id(absent in MAX API, always 0) as marker → now usesmarkerfrom the responseX-Max-Signature→X-Max-Bot-Api-Secret(real webhooks were rejected when a secret was set)GetPinnedMessageAsyncparses{"message": ...};AddChatAdminRequestsends{"admins":[...]}payload+ root fields (filename,size,thumbnail,duration, …);StickerAttachment,ShareAttachmentmessage_id,user_id,admin_id,title,is_channel,muted_until,start_payloadUser-AgentMicrosoft.SourceLink.GitHub8.0.0 → 10.0.401 (vulnerableMicrosoft.Build.Tasks.Gitmadedotnet restorefail with NU1902)Second commit — fixes from a multi-agent adversarial review of the first commit
MapMaxWebhookshare one pipeline), no fallback to unconfiguredIOptions<MaxBotOptions>,Webhook.HandlerTimeoutapplied, secret format validated, options updated only onsuccess: trueStopAsyncwaits for parallel handlers,AllowedUsernameschecks the callback presserattachment.not.readyretried bySendMessageAsync(SendMessageRequest)too; non-seekable upload streams buffered for retries; derived photo token not serialized next tophotos; no trailing GET after resumable video/audio upload;Retry-Afterin the past handledGetChatMembersPageAsyncwith marker,open_app/clipboardbuttons,message_chat_createdchat idTest plan
dotnet format --verify-no-changes,dotnet format analyzers --verify-no-changesdotnet build -c Release -warnaserrordotnet test— 722 tests pass on net10.0 / net9.0 / net8.0, line coverage 81.25%dotnet packproducesMaxMessenger.Bot.0.7.0-alphanupkg/snupkg🤖 Generated with Claude Code
https://claude.ai/code/session_01JWng6Vbuo8rweWS5x8PX56