Skip to content

feat: revamp retry classification and switch to @mondaydotcomorg/api …#11

Merged
josephsamonday merged 2 commits into
masterfrom
feat/retry_behavior
May 18, 2026
Merged

feat: revamp retry classification and switch to @mondaydotcomorg/api …#11
josephsamonday merged 2 commits into
masterfrom
feat/retry_behavior

Conversation

@josephsamonday

@josephsamonday josephsamonday commented May 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Replaced monday-sdk-js with ApiClient from @mondaydotcomorg/api
    in MondayClientCallMondayApiTask. ClientError is normalized into
    the existing MondayError shape so downstream retry logic is unchanged.
  • Flipped retry classification from an allow-list to a deny-list. We now
    retry by default and only treat errors as terminal when they match
    TERMINAL_MONDAY_ERROR_CODES (e.g. Unauthorized,
    ResourceNotFoundException, InvalidArgumentException, …) or a
    non-retryable 4xx. 429 and 423 remain retryable; 5xx stays retryable.
  • Extracted classification into isRetryableMondayError and
    getRetryAfterSeconds in retry-utils, and moved constants into
    src/constants/monday-error-codes.ts.
  • Loosened MondayApiError / MondayErrorExtensions types so we
    tolerate error_code vs code and missing status_code from the
    API's varied error shapes.
  • Added unit tests for retry-utils, sqs-producer, the API task, and the
    queue processor's retry decisions.

Motivation

The previous allow-list (only 429 / MAX_CONCURRENCY_EXCEEDED /
COMPLEXITY_BUDGET_EXHAUSTED) silently dropped transient failures that
didn'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 test passes (new suites for retry-utils, sqs-producer,
    api task, queue processor)
  • Verify against a real Monday API token that a successful query
    returns data through the new ApiClient path
  • Verify a 429 / retry_in_seconds response is honored end-to-end
    via the SQS retry path
  • Verify a terminal error (e.g. Unauthorized) does NOT retry

…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
@josephsamonday josephsamonday requested a review from venturamd May 18, 2026 17:32
@josephsamonday josephsamonday merged commit 21fde0c into master May 18, 2026
1 check passed
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