Skip to content

fix: retry MediaWiki upload on 5xx instead of failing immediately - #112

Merged
DaxServer merged 2 commits into
mainfrom
fix/mediawiki-5xx-upload-retry
Jul 5, 2026
Merged

fix: retry MediaWiki upload on 5xx instead of failing immediately#112
DaxServer merged 2 commits into
mainfrom
fix/mediawiki-5xx-upload-retry

Conversation

@DaxServer

@DaxServer DaxServer commented Jul 5, 2026

Copy link
Copy Markdown
Owner

MediaWiki upload chunk/commit requests that return a 5xx (e.g. 503) were treated identically to permanent 4xx errors — the upload was marked failed on the very first attempt, with no BullMQ retry.

  • Add MediaWikiServerError, thrown from apiUploadChunk when the upload endpoint returns a 5xx
  • Rethrow it from the worker processor alongside HashLockError/StorageError/SourceCdnError so it escapes to BullMQ instead of being marked failed immediately
  • This lets the existing attempts: 3 / exponential backoff retry policy apply to transient 5xx errors, same as it already does for source CDN 5xx errors

— Claude Sonnet 5

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
backend/src/mediawiki/client.ts Separates retryable chunk upload server errors from terminal final commit server errors.
backend/src/workers/upload.worker.ts Adds the new MediaWiki server error to the worker retry path.
backend/src/core/errors.ts Adds the new MediaWiki-specific server error class.
backend/src/tests/uploadClient.test.ts Covers chunk upload server errors and final commit server errors.
backend/src/tests/upload.worker.test.ts Covers worker behavior for the new retryable MediaWiki error.

Reviews (2): Last reviewed commit: "fix: do not auto-retry the final commit ..." | Re-trigger Greptile

Comment thread backend/src/mediawiki/client.ts
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@DaxServer
DaxServer merged commit a508092 into main Jul 5, 2026
9 checks passed
@DaxServer
DaxServer deleted the fix/mediawiki-5xx-upload-retry branch July 5, 2026 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant