Skip to content

feat: retry after rate limit error - #713

Open
Fabian Boensch (En0Ma1259) wants to merge 18 commits into
trunkfrom
feat/rate-limit-retry
Open

feat: retry after rate limit error#713
Fabian Boensch (En0Ma1259) wants to merge 18 commits into
trunkfrom
feat/rate-limit-retry

Conversation

@En0Ma1259

Copy link
Copy Markdown
Member

Problem

PayPal shipping tracking sync can receive 429 rate-limit responses with a Retry-After header. Retrying immediately, or only using the default Messenger backoff, can exhaust retries too early and move otherwise recoverable shipping sync messages into the failure flow.

Why this matters

For bulk delivery updates, PayPal may explicitly tell us when the next retry should happen. The async shipping sync should respect that delay while still keeping the normal Messenger retry limit.

Implementation

The SDK-provided retry timestamp is now transferred onto PayPalApiException.

A dedicated retry strategy for the async transport adjusts the waiting time for ShippingInformationMessage when a PayPal retry delay is available.

The strategy decorates Symfony’s default multiplier retry strategy, so existing behavior such as max_retries, exponential backoff, and failure transport handling still applies.

RecoverableMessageHandlingException is not used because it bypasses the normal max-retry decision in some Messenger flows and is not consistently supported by all queue transports. Decorating the retry strategy lets us apply Retry-After only as the delay calculation while preserving Messenger’s regular retry lifecycle.

cyl3x

This comment was marked as resolved.

@En0Ma1259

This comment was marked as resolved.

Comment thread src/RestApi/Exception/PayPalApiException.php Outdated
Comment thread src/RestApi/Exception/PayPalApiException.php Outdated
Comment thread src/RestApi/Exception/PayPalApiException.php
# Conflicts:
#	CHANGELOG.md
#	CHANGELOG_de-DE.md
#	composer.json
#	phpstan.neon.dist

@daniel3010 Daniel Vien (daniel3010) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐐

@untilu29 Chuc Le (untilu29) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ;)

Comment thread src/Checkout/SalesChannel/MethodEligibilityRoute.php Outdated
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.

PayPal Extension does not handle PayPal API rate limiting

5 participants