Skip to content

fix(github): skip Projects search index for unfiltered views - #13561

Closed
bbingz wants to merge 2 commits into
stablyai:mainfrom
bbingz:fix/12648-projects-empty-search-lag
Closed

bbingz wants to merge 2 commits into
stablyai:mainfrom
bbingz:fix/12648-projects-empty-search-lag

Conversation

@bbingz

@bbingz bbingz commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Unfiltered GitHub Project views can appear empty after bulk population because items(query: "") still uses the search index. Omit the search argument and its GraphQL variable for empty or whitespace-only filters, in both item-page and count-only requests. Filtered views continue using search.

Ported the fix to the current split Project-view modules. Pagination, field fragments, host authentication and rate-limit handling remain intact. Updated the old type comment that incorrectly recommended keeping an empty search query.

Fixes #12648

Validation

  • Rebased onto bba68b1bddf1276c8bd27ad4ca41efcbd4260321.
  • 41 focused Project-view, query-generation and table tests passed.
  • Changed-file lint/format, Node non-composite typecheck and diff checks passed.
  • Cursor reviewed the final candidate; Codex independently checked the final diff, reran the focused suite and Node typecheck before publication.
  • A live GitHub bulk-import reproduction, full suite/build and default composite typecheck were not run for this scoped query change. Default composite has the previously reproduced baseline TS2883 limitation.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: b9e7ae9e-a426-4848-bf7a-8005826bbc10

📥 Commits

Reviewing files that changed from the base of the PR and between bba68b1 and 75e0d77.

📒 Files selected for processing (7)
  • src/main/github/project-view.test.ts
  • src/main/github/project-view.ts
  • src/main/github/project-view/project-view-item-page.test.ts
  • src/main/github/project-view/project-view-item-page.ts
  • src/main/github/project-view/project-view-items-search-query.ts
  • src/main/github/project-view/project-view-items.ts
  • src/shared/github/project-types.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/main/github/project-view.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 4 remain after this review.


📝 Walkthrough

Walkthrough

The project view adds projectViewItemsUseSearchQuery to detect non-empty filters. Item-page and count-only GraphQL queries now omit search arguments and variables for empty or whitespace-only filters. Non-empty filters are trimmed before submission. Tests cover empty, whitespace-only, and substantive filters.

Priority: ➖ Normal

Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 75e0d

Unfiltered GitHub Project views now fetch items without the empty search query, avoiding misleading empty boards during search-index lag while retaining filtered search behavior.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the bug, the implementation, the linked issue, and validation results. However, it omits most required template sections, including ELI5, What Changed, Why, Visual Proof or an… Update the description to use the repository template. Add the missing sections, mark Visual Proof as N/A with a reason if applicable, document testing and platform coverage, complete the required checkboxes, and provide the required AI Dis…
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 7 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the primary change: skipping the Projects search index for unfiltered views.
Linked Issues check ✅ Passed The changes satisfy issue #12648 by omitting the GraphQL query argument and variable for empty or whitespace-only filters in both item-page and count-only requests. Filtered views continue using searc…
Out of Scope Changes check ✅ Passed The changes are limited to Project-view query behavior, related tests, exports, and an explanatory type comment. No unrelated code changes are evident.
Full details: Description check

Explanation

The description explains the bug, the implementation, the linked issue, and validation results. However, it omits most required template sections, including ELI5, What Changed, Why, Visual Proof or an N/A explanation, Testing, AI Disclosure, Review, Notes, and the Checklist.

Resolution

Update the description to use the repository template. Add the missing sections, mark Visual Proof as N/A with a reason if applicable, document testing and platform coverage, complete the required checkboxes, and provide the required AI Disclosure and review information.

  • Fix all pre-merge checks with AI

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/main/github/project-view.test.ts (1)

29-42: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Cover the query-builder contract, not only the predicate.

These tests validate projectViewItemsUseSearchQuery, but they do not verify the changed item-page and count-only GraphQL builders. Add focused tests that assert unfiltered requests omit $q, query:$q, and q, while padded filters send the trimmed value in both paths.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a0b28c53-101f-4709-ba28-e1de80a891cd

📥 Commits

Reviewing files that changed from the base of the PR and between bbcf89e and aed10e731a80ebeac49e5c9b0bba947fc0d3da2d.

📒 Files selected for processing (2)
  • src/main/github/project-view.test.ts
  • src/main/github/project-view.ts

@bbingz

bbingz commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

Ready for review (contributor priority pack)

  • Rebased / checked against current main where needed
  • Scoped bugfix; summary + test plan in the description
  • Community PR: please Approve and run workflows when convenient (fork CI stays off)
  • No maintainer merge expected from us — happy to iterate on review comments

Part of a short priority list for maintainers: P0 #13609 #13566 · hot #13710 #13692 #13691 #13536 #13572 #8072 #13237 · easy #13570 #13561 #13255.

@bbingz
bbingz force-pushed the fix/12648-projects-empty-search-lag branch from aed10e7 to 438b091 Compare August 11, 2026 19:26
@nwparker nwparker removed the P1 label Aug 19, 2026
bbingz and others added 2 commits September 9, 2026 00:58
Empty query still used items(query:\$q), which routes through GitHub's
Projects search index and can return totalCount 0 while the board is full
during index lag. Omit the query argument when the view filter is empty.

Fixes stablyai#12648.
…ters

Unfiltered item fetches omit items(query:) so boards skip search-index
lag. The View.filter field is still '' when GitHub returns null.

Co-authored-by: Cursor <[email protected]>
@bbingz
bbingz force-pushed the fix/12648-projects-empty-search-lag branch from 438b091 to 75e0d77 Compare September 8, 2026 17:02
@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Note

The previously reviewed commits are no longer reachable (likely due to a force-push or rebase), so CodeRabbit is performing a full review instead of an incremental one. This review may take a little longer.

@nwparker

Copy link
Copy Markdown
Contributor

Thanks for this @bbingz, and sorry it took a while to get a definitive answer — the premise needed checking against the live schema rather than the docs.

Closing this one, because the change is a no-op. ProjectV2.items(query:) is declared with a default of "":

$ gh api graphql -f query='{__type(name:"ProjectV2"){fields{name args{name defaultValue type{kind name}}}}}'
{"defaultValue":"\"\"","name":"query","type":{"kind":"SCALAR","name":"String"}}

Per GraphQL spec §6.4.1, an omitted argument that declares a default contributes that default to the coerced argument map — so omitting query: and passing query: "" produce the same resolver input. I confirmed GitHub applies declared defaults server-side by exercising __Type.fields(includeDeprecated: Boolean = false) on their own endpoint: omitted and explicit-default both return 14 fields, explicit non-default returns 19.

I also checked whether there was any other field to move to, and there isn't: items is the only item enumeration on ProjectV2, and ProjectV2View has no items field, so there's no view-scoped traversal either. No request shape the client can emit avoids the search index.

Your diagnosis of the symptom was right though, and it's a real bug — a view with no filter should never say "No items match this view's filter". I've picked that part up in #20588, which words the empty state from the view's own filter and adds "Recently added items can take a while to appear." for the transient case you were chasing. Credited you there.

Happy to look at anything else in this area — the instinct to go after the misleading message was the correct one.

@nwparker nwparker closed this Sep 14, 2026
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.

[Bug] Projects tab shows "No items match this view's filter" during GitHub's project search-index lag — n

4 participants