Repository navigation
fix: skip exhausted search windows - #3587
adityareddy-dev wants to merge 8 commits into
Conversation
|
Hi @adityareddy-dev, thanks for the pull request! Before we review code from a first-time contributor, a maintainer vouches for them, and you're not on our list yet. There's nothing else to file and this PR stays open — a maintainer will look at it, usually within a day or two, and vouch for you right here if it's a genuine attempt at the problem. To make that quick, check the PR description has:
More detail in our contributing guide. |
PR Review
1 finding(s): 🔴 0 critical · 🟠 0 major · 🔵 1 minor 1 posted as inline comment(s) on the changed lines. Severity is the reviewer's own estimate and is used for ordering, not filtering. No finding blocks merge automatically; a maintainer decides. |
bcacd17 to
b25c8cc
Compare
Deep Review✅ No critical issues found. The change is conservative by construction: 🟡 P2 -- recommended
🔵 P3 nitpicks (3)
Reviewers (8): testing, maintainability, project-standards, performance, reliability, previous-comments, learnings-researcher, agent-native. (The correctness, adversarial, and TypeScript reviewers did not return before synthesis; the orchestrator performed independent correctness, data-loss, and type-safety analysis of the diff in their place and found no additional defects — notably the Testing gaps:
No finding blocks merge automatically. A maintainer will expect P0/P1 findings in code this PR changes to be fixed; P2/P3 are your call -- fix or reply. Never fix findings about surrounding code here; reply instead. Do not widen the PR. How to respond |
ab7139d to
9263c98
Compare
|
Done. |
e508541 to
bdac94d
Compare
|
@adityareddy-dev is attempting to deploy a commit to the ClickHouse Team on Vercel. A member of the Team first needs to authorize it. |
2a44a78 to
7b0c09f
Compare
7b0c09f to
aa6623c
Compare
|
Fixed. |
ea17b69 to
01081a8
Compare
| }); | ||
| const sourceSettings = new Map( | ||
| source?.querySettings | ||
| ?.filter(({ setting, value }) => setting.length && value.length) |
There was a problem hiding this comment.
🔵 minor — Empty-setting filter copies joinQuerySettings and can drift from the SQL actually sent
The setting.length && value.length filter repeats the one in joinQuerySettings (packages/common-utils/src/core/utils.ts:1393), which decides which source settings reach the SQL SETTINGS clause. The inference here is only correct if both filters stay identical. Fix: export a small filterQuerySettings (or querySettingsToMap) helper from common-utils and use it in both places.
Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond
| source?.querySettings, | ||
| ); | ||
|
|
||
| let canSkipShortPage = false; |
There was a problem hiding this comment.
🔵 minor — The check for whether query limits can truncate a page is about 60 lines of logic written inline in the queryFn, and it repeats the empty-setting filter from joinQuerySettings
Move this logic into a pure helper next to joinQuerySettings in packages/common-utils/src/core/utils.ts (for example canResultBeTruncated(serverSettings, querySettings, queryTimeout, limit)). The helper should reuse that file's setting.length && value.length filter (utils.ts:1393) so the SETTINGS rendering and this check can't drift apart. Then unit-test it directly instead of through roughly 80 hook renders.
Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond
Summary
A short search page triggered another query in the same time window. I now skip that query only when the effective query limits rule out truncation. Capped or unknown results keep paging within the window.
Fixes #1403.
How to reproduce
Starting point: A search spanning multiple time windows, with a page limit of 100 and only one matching row in the first window.
On
main:OFFSET 1.On this branch:
throwor its limits disabled.OFFSET 0.How to test on Vercel preview
N/A, query pagination change with no visual changes.
References
#1403