Skip to content

fix(earn): load eligible yields by token to avoid WAF 403 blocks - #571

Merged
petar-omni merged 1 commit into
mainfrom
fix/yield-directory-token-loading
Sep 16, 2026
Merged

petar-omni merged 1 commit into
mainfrom
fix/yield-directory-token-loading

Conversation

@petar-omni

Copy link
Copy Markdown
Contributor

Added

  • Support for filtering yields by token in YieldDirectoryKey, YieldDirectoryRequest, and toYieldDirectoryParams.
  • YIELD_IDS_CHUNK_SIZE = 20 constant in pagination helpers to bound fallback query sizes.
  • Unit tests verifying token-based yield loading via standard offset pagination and 20-item chunk boundaries for explicit ID queries.

Changed

  • Updated readYieldCatalog on the initial earn page to query the Yield API using the selected token (address or symbol) instead of serializing all availableYields into the query string, eliminating URL bloat that triggered AWS WAF SizeRestrictions_QUERYSTRING 403 Forbidden blocks.
  • Reduced the explicit yieldIds chunk size from 100 to 20 for non-token loading paths (e.g. positions, multi-yields) to keep query strings safely under 2,048 bytes.

Fetch token-eligible yields on the initial earn page by passing the
selected token to the Yield API instead of serializing dozens of yield
IDs into the query string. This prevents exceeding AWS WAF's 2KB query
string limit (SizeRestrictions_QUERYSTRING).

Also reduce the fallback yield IDs chunk size from 100 to 20 for paths
that must still fetch yields by explicit identifiers.
@changeset-bot

changeset-bot Bot commented Sep 16, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: f934093

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@aws-amplify-eu-central-1

Copy link
Copy Markdown

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-571.df4xyoi0xyeak.amplifyapp.com

@aws-amplify-eu-central-1

Copy link
Copy Markdown

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-571.d2ribjy8evqo6h.amplifyapp.com

@petar-omni
petar-omni merged commit d355429 into main Sep 16, 2026
10 checks passed
@petar-omni
petar-omni deleted the fix/yield-directory-token-loading branch September 16, 2026 10:42
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.

3 participants