Skip to content

test(search): preserve filters during cursor fetch - #1568

Merged
Sinity merged 1 commit into
masterfrom
feature/test/search-cursor-filtered-spec-builder
May 25, 2026
Merged

Sinity merged 1 commit into
masterfrom
feature/test/search-cursor-filtered-spec-builder

Conversation

@Sinity

@Sinity Sinity commented May 25, 2026

Copy link
Copy Markdown
Owner

Summary

This adds focused #873 acceptance evidence for filtered cursor continuation in the shared search envelope builder.

Problem

Cursor/keyset behavior was covered at the payload layer, but the API/daemon spec builder also has to advance the backend fetch past the cursor anchor without dropping active query filters. That path is where provider/tag/date filters could regress while cursor tests still pass.

Solution

Added a builder regression that constructs a filtered ConversationQuerySpec with provider, tag, since, limit, offset, and cursor. The test proves the fetch spec preserves filters while advancing offset/limit for cursor trimming, and that the returned envelope keeps the caller-facing limit/offset.

Verification

  • pytest -q tests/unit/api/test_search_envelope_builder.py tests/unit/surfaces/test_search_cursor_pagination.py --tb=short — 16 passed.
  • ruff format --check tests/unit/api/test_search_envelope_builder.py — passed.
  • ruff check tests/unit/api/test_search_envelope_builder.py — passed.
  • mypy tests/unit/api/test_search_envelope_builder.py — passed.
  • devtools verify --json — exit 0; 2 pytest-testmon selected tests passed; total 40.56s.
  • pre-push devtools verify --quick — exit 0; total 33.76s.

Ref #873

Problem: #873 cursor stability was covered at the payload layer, but the shared API/daemon envelope builder also has to advance a cursor fetch without dropping active filters.\n\nWhat changed: added a builder regression proving provider, tag, and since filters survive cursor-driven fetch advancement, while the caller-facing envelope retains the original limit and offset.\n\nVerification: pytest -q tests/unit/api/test_search_envelope_builder.py tests/unit/surfaces/test_search_cursor_pagination.py --tb=short; ruff format/check on the touched test; mypy on the touched test; devtools verify --json (2 selected tests passed).\n\nRef #873
@coderabbitai

coderabbitai Bot commented May 25, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@Sinity, we couldn't start this review because you've used your available PR reviews for now.

Your plan includes 1 review of capacity. Refill in 31 minutes and 26 seconds.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more review capacity refills, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 24a03499-aa78-4d31-aea7-ddcb8588168b

📥 Commits

Reviewing files that changed from the base of the PR and between 4d01e66 and 968f849.

📒 Files selected for processing (1)
  • tests/unit/api/test_search_envelope_builder.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/test/search-cursor-filtered-spec-builder

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Sinity
Sinity merged commit 7265ef0 into master May 25, 2026
4 checks passed
@Sinity
Sinity deleted the feature/test/search-cursor-filtered-spec-builder branch May 25, 2026 10:00
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.

1 participant