Repository navigation
fix(creators): paginate admin applications list and bound digit inputs - #948
Open
mopxam-art wants to merge 1 commit into
Open
mopxam-art wants to merge 1 commit into
mopxam-art wants to merge 1 commit into
Conversation
- Add limit and offset pagination parameters to GET /v1/admin/creators/applications with total and has_more - Enforce length bound (<= 19 digits) and non-negative integer check on sequence and maturity_date strings - Guard against numeric overflow to Infinity for maturityDate and enforce safe integer limits (400 instead of 500) - Add comprehensive test matrix covering pagination boundaries, query combinations, and error controls Closes Heliobond#890 USDC: 0x387c064ccf729a4846b62e95dc6b70e4d4c41e73
This branch has not been deployed
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.
Why
The admin applications review endpoint
GET /v1/admin/creators/applicationsreturned the entire collection with no pagination, causing performance degradation as application volume grew. Additionally,GET /v1/creators/applications/:id/create-project-txaccepted arbitrary-length digit strings forsequenceandmaturity_datewithout length or value bounds, causing large inputs (such as 400-digit numbers) to overflowNumber(maturityRaw)toInfinityand trigger 500 crashes during XDR encoding.What
limit(default 20, max 100) andoffset(default 0) pagination parameters toGET /v1/admin/creators/applicationsreturning{ applications, total, limit, offset, has_more }.<= 19characters) onsequence,maturity_date, andwhitelister_sequenceto prevent overflow and reject invalid inputs with HTTP 400.maturity_dateagainstu64::MAXandNumber.MAX_SAFE_INTEGER, returning structured 400 bad request errors instead of 500 runtime exceptions.buildCreateProjectTxandbuildUnsignedinsrc/lib/creatorOnboarding.tswith explicit input validation throwingCreatorValidationError.src/__tests__/creator-admin-pagination-and-bounds.test.ts).Verified
npx jest src/__tests__/creator-admin-pagination-and-bounds.test.ts).npx jest src/__tests__/creator-onboarding.test.ts).npx tsc --noEmit).npm run lint).npm run build).Closes #890