feat: add send photo command with retries - #18
Merged
Conversation
This was referenced Mar 13, 2026
- Log getMessages enrichment errors instead of silently swallowing them - Log auth check failures to stderr before returning false - Wrap onRetry callback in try-catch to protect retry loop - Complete README send photo flags table (topic, silent, no-forwards, etc.) - Add unit tests for classifySendError, getRetryDelayMs, formatSendErrorMessage - Add test for onRetry callback crash resilience Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Log onRetry callback errors instead of silently swallowing them - Log non-ENOENT errors in resolveEntrypointPath - Add tests for: retry exhaustion, extractMessageIdFromSendUpdates null, preparePhotoMessage parse-mode without caption, retries:0 edge case, parseRetryBackoff invalid input, buildSendSuccessPayload without media, buildSendPhotoSuccessPayload inputChatId fallback Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Narrow catch scope in sendPreparedPhotoMessage to only getMessages - Emit structured JSON retry events to stderr in JSON mode - Add tests for: timeout before second attempt, retryable "timed out" message, inputPeerUser peer extraction, invalid photo filePath Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Change fallback error type from 'network' to 'unknown' for unrecognized errors - Skip wrapping TypeError/ReferenceError/SyntaxError/RangeError in normalizeSendCommandError - Add tests for: timeout before first attempt, media without fileId, normalizeSendCommandError behavior, FLOOD_WAIT design decision Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add tests for MtRpcError name variant classification - Add tests for "Request timeout" substring retryable behavior Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add test for getRetryDelayMs with explicit backoff objects Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add warning field to degraded photo response when enrichment fails - Re-throw TypeError/ReferenceError from onRetry callback - Add writeError and logSendRetry tests - Export writeError and logSendRetry for testability - Add warning propagation tests for buildSendSuccessPayload Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add buildSendPhotoSuccessPayload warning propagation tests - Add sleep clamping to remaining timeout budget test Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add test for extractMessageIdFromSendUpdates fallback path - Add test for ETIMEDOUT code precedence over bare Timeout message Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove unused vi.fn() mock variable in timeout test Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
dapi
force-pushed
the
feature/issue-16-send-photo-retries-json-output
branch
from
March 13, 2026 09:26
de68636 to
472a3b3
Compare
The function was already imported from core/retry.js; the local duplicate introduced during rebase caused a SyntaxError. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Closes #16