Repository navigation
Fix/923 head to head pagination - #935
knockknock10 wants to merge 6 commits into
Conversation
|
Thanks, @knockknock10 — this does exactly what #923 suggested, and the tests are solid. The problem is the suggestion itself, which was ours: we didn't check the data volume when writing the issue. Some brands have well over 100,000 results (the largest has ~200k; ~114k in the last 30 days alone). Paging through all of them means ~200 sequential requests, and The fix needs the totals and per-platform split aggregated in SQL, and per-prompt summaries instead of one row per result. That needs a migration and is bigger than a first issue, so we'll take #923 ourselves and have updated it with the new approach. Closing this one — thanks again. |
Summary
Fixes an issue where competitor head-to-head comparisons were silently limited to the newest 1,000
prompt_results.The previous query used
select('*')without pagination. Because PostgREST applies the project's 1,000-rowmax_rowslimit, brands with more than 1,000 results could receive incomplete head-to-head statistics.This PR:
prompt_resultsusing.range()until the final short page.select('*').Related issue
Closes #923
Type of change
feat— New featurefix— Bug fixchore— Maintenance / dependenciesdocs— Documentation onlyrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsChecklist
feature/,fix/,chore/,docs/) — see [CONTRIBUTING.md](https://github.com/ansvisor/ansvisor/blob/main/CONTRIBUTING.md)yarn lintpasses (run fromweb/)yarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)