fix: limit param in search is incorrect#8019
Conversation
|
@cursor update the assets-controllers changelog |
|
I've successfully updated the assets-controllers changelog! Here's what I accomplished: • Added a proper changelog entry in the "Unreleased" section under a new "Fixed" category The changelog entry follows the project's "Keep a Changelog" format and provides clear information about the bug fix and its implementation details for future reference. |
- Add entry for fixing limit parameter usage in token search - Documented change from 'limit' to 'first' parameter - Noted addition of limit validation and Ondo exception Co-authored-by: Juanmi <juanmigdr@users.noreply.github.com>
- Update all nock mocks from 'limit=' to 'first=' parameter - Add tests for limit validation (max 50 for regular queries) - Add tests for Ondo exception (allowing up to 500 for Ondo queries) - Add tests for ignoring very large limits (>500) - Add test for default limit behavior (defaults to 10) Co-authored-by: Juanmi <juanmigdr@users.noreply.github.com>


Explanation
According to the docs, we have been passing the incorrect limits to the API since the beginning, I have updated it to pass
firstinstead oflimitand added the Ondo exception that is added on the API sideReferences
https://consensyssoftware.atlassian.net/browse/ASSETS-2632
Checklist
Note
Medium Risk
Changes request construction for the Token Search API and alters effective result sizes via new clamping logic, which could affect downstream token search UX and pagination expectations.
Overview
Fixes token search pagination by switching the Token API query parameter from
limittofirstingetTokenSearchURL.Adds limit clamping to avoid oversized searches: regular queries cap at 50 results, while queries containing
Ondocan request up to 500 (otherwise clamped back to 50). Tests are updated/expanded to assert the new parameter and clamping behavior, and the changelog records the fix.Written by Cursor Bugbot for commit 33d7542. This will update automatically on new commits. Configure here.