Skip to content

fix(github-project): fall back when search-index lag returns zero items - #12819

Open
innocarpe wants to merge 2 commits into
stablyai:mainfrom
innocarpe:fix/projects-index-lag-fallback
Open

fix(github-project): fall back when search-index lag returns zero items#12819
innocarpe wants to merge 2 commits into
stablyai:mainfrom
innocarpe:fix/projects-index-lag-fallback

Conversation

@innocarpe

Copy link
Copy Markdown
Contributor

Description

When an unfiltered Project view returns totalCount 0 via the search-index query:"" path, retry once with plain items(first:N) so index lag does not show a false empty board.

Focused fix

  • In scope: empty unfiltered fetch fallback in getProjectViewTable
  • Out of scope: changing filtered view query semantics

Preserves

  • Real empty boards stay empty; real filters still use query

Evidence

  • Test: pnpm exec vitest run --config config/vitest.config.ts src/main/github/project-view.test.ts src/main/github/project-view-host-auth.test.ts src/main/github/project-view/mutations.test.ts (44 passed)

User-regression-tradeoffs

  • One extra GraphQL page only when unfiltered index returns zero

Fixes #12648

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@innocarpe, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 20 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

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

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8f8da953-2b07-4ffe-8f2d-01b443d4aa74

📥 Commits

Reviewing files that changed from the base of the PR and between 630f13b and f6c8b06.

📒 Files selected for processing (2)
  • src/main/github/project-view-index-lag-fallback.test.ts
  • src/main/github/project-view.ts
📝 Walkthrough

Walkthrough

Project view item requests now accept nullable search queries. GraphQL omits the search variable and argument when the query is null. getProjectViewTable retries an unfiltered view once without a search query when the initial successful result contains zero items. Explicit query overrides do not trigger the retry.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the fix and testing evidence but omits most required template sections, including screenshots, checklists, AI review, security audit, and notes. Use the required headings and add screenshots status, testing checklist results, AI review findings, security audit details, and platform-specific notes.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the GitHub Project fix and the fallback for search-index lag returning zero items.
Linked Issues check ✅ Passed The changes implement the linked issue objective by retrying unfiltered zero-item queries without the search argument while preserving filters and genuine empty boards.
Out of Scope Changes check ✅ Passed The changes are limited to the unfiltered empty-result fallback and do not alter filtered query semantics.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4a23e44d-117e-4b1d-9e10-4b130ad84244

📥 Commits

Reviewing files that changed from the base of the PR and between 79896cb and f6a8ebc.

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

Comment thread src/main/github/project-view.ts Outdated
Unfiltered Project views still query with `query:""`, which uses GitHub's
search index. When a fresh board is empty only in the index, retry once
with plain items(first:N) so cards appear without a misleading empty state.

Preserves true empty boards and all real view filters.

Fixes stablyai#12648
Only replace a successful empty search-index result when the no-search
retry itself succeeds, so a rate-limit on the fallback does not turn a
real empty view into an error.

Fixes CodeRabbit on stablyai#12819.
@innocarpe
innocarpe force-pushed the fix/projects-index-lag-fallback branch from f6a8ebc to f6c8b06 Compare August 6, 2026 01:58
@innocarpe

Copy link
Copy Markdown
Contributor Author

Sync update (f6c8b06e96)

Address CodeRabbit: only replace empty index result when the no-search fallback succeeds (genuinely empty boards stay empty on fallback failure). @coderabbitai please re-review

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

git status --short
git show --stat --oneline --decorate --no-renames f6c8b06e964a0da58ca7087696ce86a7ab6e3955
git diff f6c8b06e964a0da58ca7087696ce86a7ab6e3955^ f6c8b06e964a0da58ca7087696ce86a7ab6e3955 -- src/main/github/project-view.ts
printf '\n--- source outline ---\n'
ast-grep outline src/main/github/project-view.ts --items all --view expanded
printf '\n--- project-view test candidates ---\n'
fd -t f -i 'project-view' . | sort
printf '\n--- fallback-related references ---\n'
rg -n -C 4 'getProjectViewTable|searchQuery|totalCount|items\(first' src test tests 2>/dev/null || true

Length of output: 201138


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- commit files ---'
git diff-tree --no-commit-id --name-status -r f6c8b06e964a0da58ca7087696ce86a7ab6e3955

printf '%s\n' '--- exact commit diff ---'
git diff --no-ext-diff --unified=80 \
  f6c8b06e964a0da58ca7087696ce86a7ab6e3955^ \
  f6c8b06e964a0da58ca7087696ce86a7ab6e3955 \
  -- src/main/github/project-view.ts

printf '%s\n' '--- focused implementation ---'
rg -n -C 35 'async function getProjectViewTable|function getProjectViewTable|const getProjectViewTable|fetch.*Project.*Items|totalCount === 0|searchQuery' \
  src/main/github/project-view.ts

printf '%s\n' '--- direct test files ---'
fd -t f -e ts -e tsx . | rg '(^|/)(project-view|github-project).*(test|spec)\.(ts|tsx)$' || true

printf '%s\n' '--- focused test cases ---'
rg -n -C 18 'getProjectViewTable|totalCount === 0|fallback|no-search|query: ""|search-index' \
  --glob '*.{test,spec}.{ts,tsx}' \
  src/main 2>/dev/null || true

Length of output: 201421


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- changed-file patch ---'
git show --format= --no-ext-diff --unified=50 \
  f6c8b06e964a0da58ca7087696ce86a7ab6e3955 -- src/main/github/project-view.ts

printf '%s\n' '--- current changed file ---'
cat -n src/main/github/project-view.ts

printf '%s\n' '--- exact project-view test candidates ---'
rg --files | rg '(^|/)project-view[^/]*\.(test|spec)\.(ts|tsx)$|(^|/)project-view\.(test|spec)\.(ts|tsx)$' || true

printf '%s\n' '--- direct references to project-view module ---'
rg -n -l -g '*.{test,spec}.ts' -g '*.{test,spec}.tsx' \
  "from ['\"].*project-view['\"]|import\(['\"].*project-view['\"]\)" . || true

Length of output: 80859


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- fallback test file ---'
cat -n src/main/github/project-view-index-lag-fallback.test.ts

printf '%s\n' '--- test changes in the sync commit ---'
git show --format= --name-status \
  f6c8b06e964a0da58ca7087696ce86a7ab6e3955 -- \
  src/main/github/project-view-index-lag-fallback.test.ts
git show --format= --no-ext-diff --unified=30 \
  f6c8b06e964a0da58ca7087696ce86a7ab6e3955 -- \
  src/main/github/project-view-index-lag-fallback.test.ts

printf '%s\n' '--- targeted fallback assertions ---'
rg -n -C 8 'preferSuccessfulIndexLagFallback|fallback|empty|ok:' \
  src/main/github/project-view-index-lag-fallback.test.ts

Length of output: 4103


@innocarpe: Re-review complete. I found no new issues.

The fallback now preserves the initial successful empty result when the no-search request fails. It replaces that result only when the fallback succeeds. The added regression tests cover both paths.

⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@AmethystLiang AmethystLiang added the P1 High priority: bug or day-to-day user frustration label Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P1 High priority: bug or day-to-day user frustration

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

3 participants