feat: revamp retry classification and switch to @mondaydotcomorg/api …#11
Merged
Conversation
…client - Replace monday-sdk-js with ApiClient from @mondaydotcomorg/api in MondayClientCallMondayApiTask; normalize ClientError into MondayError - Switch retry policy from allow-list to deny-list: retry by default unless the error matches TERMINAL_MONDAY_ERROR_CODES or a non-retryable 4xx status (429/423 still retried) - Extract retry classification into isRetryableMondayError / getRetryAfterSeconds in retry-utils - Move MondayErrorCodes and add TERMINAL_MONDAY_ERROR_CODES / RETRYABLE_HTTP_STATUS_CODES to src/constants/monday-error-codes.ts - Loosen MondayApiError / MondayErrorExtensions types to tolerate variations in the API's error shape (error_code, optional status_code) - Add unit tests for retry-utils, sqs-producer, the api task, and the queue processor's retry decisions
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
monday-sdk-jswithApiClientfrom@mondaydotcomorg/apiin
MondayClientCallMondayApiTask.ClientErroris normalized intothe existing
MondayErrorshape so downstream retry logic is unchanged.retry by default and only treat errors as terminal when they match
TERMINAL_MONDAY_ERROR_CODES(e.g.Unauthorized,ResourceNotFoundException,InvalidArgumentException, …) or anon-retryable 4xx. 429 and 423 remain retryable; 5xx stays retryable.
isRetryableMondayErrorandgetRetryAfterSecondsinretry-utils, and moved constants intosrc/constants/monday-error-codes.ts.MondayApiError/MondayErrorExtensionstypes so wetolerate
error_codevscodeand missingstatus_codefrom theAPI's varied error shapes.
queue processor's retry decisions.
Motivation
The previous allow-list (only 429 /
MAX_CONCURRENCY_EXCEEDED/COMPLEXITY_BUDGET_EXHAUSTED) silently dropped transient failures thatdidn't match those exact signals. Inverting to a deny-list of known
terminal errors lets us retry unknown/transient failures by default
while still failing fast on genuinely non-retryable cases.
Test plan
npm testpasses (new suites for retry-utils, sqs-producer,api task, queue processor)
returns data through the new
ApiClientpathretry_in_secondsresponse is honored end-to-endvia the SQS retry path
Unauthorized) does NOT retry