Skip to content

fix(mobile): long pull request searches on iOS no longer fail the list - #29850

Open
saphid wants to merge 1 commit into
pingdotgg:mainfrom
saphid:fix/contractcaps
Open

saphid wants to merge 1 commit into
pingdotgg:mainfrom
saphid:fix/contractcaps

Conversation

@saphid

@saphid saphid commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Problem

On iOS, the Pull Requests search uses the native header search bar, and it has no length limit. The contract caps PullRequestListInput.query at 200 characters. If you type or paste more than 200 characters of search text, every PR list request fails with SchemaError(Expected a value with a length of at most 200 at ["query"]), so the list shows an error instead of results.

The other surfaces already respect the limit. The mobile search field used on Android and iPhone Duo sets maxLength={200} on the pull requests tab, and web cuts q to 200 characters in the route's validateSearch.

Change

pullRequestListInput now cuts the leftover search text to 200 characters and trims it before sending. Qualifiers such as draft: or label: are parsed out before the cut, so they still apply. Both mobile platforms build the request here, so this one change covers the iOS path.

Scope and approval

Very small, focused fix for an obvious bug, so no prior issue: a mobile request builder sends a value the shared contract rejects, while its sibling input paths already cap it. It changes one line of behavior and adds one test assertion.

Overlap search: the local PR index plus REST searches for mobile PR search length, pullRequestListInput, and the iOS search bar maxLength. The closest PR is #28095, which changes qualifier parsing in pullRequestQuery.ts and does not touch this length. #19934 (merged) added typed qualifiers to mobile search without a length cap.

Verification

  • Red on main: the existing case reads a typed draft qualifier as a filter and searches only the text left over in apps/mobile/src/features/pull-requests/pullRequestList.test.ts gets an extra assertion that a long query still produces a valid PullRequestListInput. On main it fails with AssertionError: expected false to be true.
  • Green: vp test run src/features/pull-requests/pullRequestList.test.ts in apps/mobile passes 24 of 24.
  • vp run check:changed passes format, lint, knip, typecheck (2 packages), tests, and the React Compiler check.
  • Not checked: a run on a real iOS device or simulator. The failing step is the contract encode, which the test covers.

Reviewed with sol-loop: 1 round with GPT-6.1 Sol on high. Sol verdict: approved.

Created with Claude Opus 5.5 in Claude Code (T3 Code).

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Nov 3, 2026
@macroscopeapp

macroscopeapp Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at e7c43ab

Macroscope's review found this PR approvable — Mobile pull-request searches now trim and cap query text at the existing 200-character wire limit. The change is confined to search request normalization and leaves listing defaults and data unchanged.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Walkthrough

The pull request list input now caps query text at 200 characters, trims it, and includes it only when nonempty. A test checks that a long query produces input that matches the schema.

Changes: Pull request query normalization

Layer / File(s) Summary
Normalize and validate query input
apps/mobile/src/features/pull-requests/pullRequestList.ts, apps/mobile/src/features/pull-requests/pullRequestList.test.ts
The input builder caps and trims parsed query text, then omits it if the result is empty. The test checks that a long query produces input that satisfies the schema.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: bil0000

Merge Risk: Minimal · up to e7c43

No actionable merge-blocking risk was identified in this query-normalization change.

Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title clearly describes the main change: preventing long mobile pull request searches from failing on iOS. It is concise and uses a conventional commit format.
Description check Passed The description includes complete Problem, Change, Scope and approval, and Verification sections. It explains the bug, implementation, approval rationale, test results, and unverified real-device test…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description includes complete Problem, Change, Scope and approval, and Verification sections. It explains the bug, implementation, approval rationale, test results, and unverified real-device testing.

Finishing Touches
Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

ast-grep (0.51.1)

ast-grep could not parse rule config: /ast-grep-rules/ast-grep-essentials/rules/rust/security/weak-cipher-des-rc4-ecb-rust.yml

Usage-based review receipt

Note

This review was completed with usage-based billing: files reviewed beyond your plan's included limits are billed at $0.25/file. View usage-based billing.

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between e0f69e9 and e7c43ab.

Files selected for processing: 2
  • apps/mobile/src/features/pull-requests/pullRequestList.test.ts
  • apps/mobile/src/features/pull-requests/pullRequestList.ts

Limit details: You’ve used all 10 included reviews currently available.

@saphid

saphid commented Nov 13, 2026

Copy link
Copy Markdown
Contributor Author

Review requested

Date (UTC) Reviewer Where
2026-11-13 Julius Discord DM

Logged so this PR shows when a maintainer was asked to review it.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant