Skip to content

Fix collections sorting fallback - #1623

Merged
stefangutica merged 3 commits into
developmentfrom
collections-sorting-fallback
Aug 20, 2026
Merged

Fix collections sorting fallback#1623
stefangutica merged 3 commits into
developmentfrom
collections-sorting-fallback

Conversation

@stefangutica

@stefangutica stefangutica commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

Reasoning

  • When sorting collections by verifiedAndHolderCount, api_isVerified and api_holderCount are not present on every document in the tokens index.
  • Without an explicit fallback, a missing value was interpreted as a very large negative number, which broke the searchAfter cursor and returned an internal server error.
  • Elasticsearch sorts booleans as 0/1, so a missing api_isVerified should simply be treated as false, i.e. 0.

Proposed Changes

  • Add missing: 0 to the api_isVerified sort field, so collections without the flag sort as not verified.
  • Add missing: 0 to the api_holderCount sort field, so collections without a holder count sort as zero holders.

How to test

  • GET /collections?sort=verifiedAndHolderCount&size=25 should return 200.
  • Paginate further with the searchAfter cursor returned by the last item and confirm it works.

@github-actions

github-actions Bot commented Aug 20, 2026

Copy link
Copy Markdown

k6 load testing comparison.
Base Commit Hash: b02a3e7
Target Commit Hash: 3f13262

Metric Base Target Diff
AvgMax9095AvgMax9095AvgMax9095
Tokens21.43275.4529.3334.91338.8644984.58111.87121.50+1481.45% 🔴+16231.35% 🔴+281.46% 🔴+248.06% 🔴
Accounts85.97317.36190.12202.16114.75427.09197.81209.41+33.47% 🔴+34.58% 🔴+4.05% 🔴+3.59% 🔴
Transactions52.1610458.2761.6270.26116.6128510.14104.05112.40+123.55% 🔴+172.61% 🔴+68.87% 🔴+59.98% 🔴
Nodes44.129068.5239.7075.16189.7815084.44107.65117.54+330.12% 🔴+66.34% 🔴+171.15% 🔴+56.37% 🔴
Mex21.40150.4329.3334.8323.20400.8047.0961.23+8.41% 🔴+166.43% 🔴+60.55% 🔴+75.82% 🔴
Pool21.41260.0429.3434.8623.15400.6547.1860.84+8.11% 🔴+54.07% 🔴+60.77% 🔴+74.53% 🔴
Blocks30.92517.6151.3358.6843.16432.5993.87104.91+39.56% 🔴-16.43% ✅+82.89% 🔴+78.77% 🔴
Test Run Duration60001.2560004.38

Legend: Avg - Average Response Time, Max - Maximum Response Time, 90 - 90th Percentile, 95 - 95th Percentile
All times are in milliseconds.

@stefangutica
stefangutica merged commit 8d7e2e3 into development Aug 20, 2026
6 of 9 checks passed
@stefangutica
stefangutica deleted the collections-sorting-fallback branch August 20, 2026 11:57
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