Skip to content

fix(search): preserve loaded jobs when retrying facets - #4608

Merged
strelov1 merged 1 commit into
mainfrom
fix/facet-quota-retry
Nov 14, 2026
Merged

strelov1 merged 1 commit into
mainfrom
fix/facet-quota-retry

Conversation

@strelov1

@strelov1 strelov1 commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

When only facet counts hit the search quota, retrying currently reloads the healthy job list too. If that extra request is also limited, visible vacancies disappear behind an error.

Retry facet counts on every retry, and reload vacancies only when the list itself failed. This also preserves the recovery path for simultaneous list and facet failures introduced in #4596.

Validation: the extended facets-only Playwright scenario failed before the guard and passed afterward; all three search-quota browser scenarios passed. The browser ran the real Svelte app against read-only production API requests because local Docker was unavailable. The original feature was previously verified against an isolated Go/Postgres/Meilisearch stack. Changed-file ESLint, formatting and the repository file-size check passed; independent review found no actionable issues.


Note

Low Risk
Small UX guard in client search retry logic with added E2E coverage; no auth, billing, or server API changes.

Overview
Retry search no longer reloads the job list when vacancies loaded successfully but only facet counts hit the quota. retrySearch still always refreshes facet counts; reloadList runs only when jobs.status === 'error', so a healthy list stays on screen instead of being replaced by a second rate-limited search request.

The facets-only Playwright scenario now asserts that after Retry search, facet requests fire again while search is not retried (listRetries === 0), the limit notice remains, and job cards stay visible even if search would still return 429.

Reviewed by Cursor Bugbot for commit 7d56100. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by CodeRabbit

  • Bug Fixes
    • Retrying after a facet request is refused now refreshes facet counts without reloading job results unless the job list is in an error state. Existing job rows and the quota notice remain visible when search requests are throttled.

Deployment status: activated in production at 2026-11-15 01:57:43 UTC after the operator hold was cleared and the UI including freehire#4608 was deployed. Public search and facets return HTTP 200 with X-RateLimit-Limit: 300. Authenticated MCP search returned 10 actual vacancies; anonymous MCP initialization returns 401. Three production-browser quota/retry scenarios passed, and the live Sao Paulo page renders job cards.

@cursor

cursor Bot commented Nov 14, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: 5a7a7142-a7b2-4c38-9ebe-e7b7c3de2e26)

@strelov1
strelov1 enabled auto-merge (squash) November 14, 2026 15:00
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-14T15:02:11.165923Z 7d56100 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The retry now reloads jobs only when the paginator is in the error state. It continues to refresh facet counts. The end-to-end test checks retry behavior after a facet refusal.

Changes: Facet retry behavior

Layer / File(s) Summary
Conditional job reload and retry validation
web/src/lib/components/JobsView.svelte, web/e2e/search-rate-limit.spec.ts
The retry skips reloading jobs unless the paginator is in the error state, while continuing to refresh facet counts. The test verifies that a retry requests facets again without calling the throttled search endpoint, and that the quota notice and loaded job row remain visible.

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

Change: Bug fix

Merge Risk: Minimal · up to 7d561

Retrying after a facet refusal no longer reloads an already loaded job list, so loaded vacancies are not hidden behind an error. Recovery still works when both the list and facets fail. The change is small and easy to revert, and no merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "fix(search): preserve loaded jobs when retrying facets" matches the main change. The JobsView.svelte change makes retrySearch reload the job list only when the paginator is in the error sta…
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: Title check

Explanation

The title "fix(search): preserve loaded jobs when retrying facets" matches the main change. The JobsView.svelte change makes retrySearch reload the job list only when the paginator is in the error state, while facet counts still refresh on every retry. The e2e test adds a retry scenario that checks loaded job rows stay visible while the search endpoint remains throttled. The title is specific, concise, and conventional, and it names the primary behavior change.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between d319fcf and 7d56100.

Files selected for processing: 2

  • web/e2e/search-rate-limit.spec.ts
  • web/src/lib/components/JobsView.svelte

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 3 remain after this review.

@github-actions

Copy link
Copy Markdown
Contributor

OpenCodeReview — commit 7d561003a8ac

low · web/src/lib/components/JobsView.svelte:426
The new guard is only correct relative to the two current render branches: the facet banner (line 905) is shown only while jobs.status !== 'error', and the list-error branch (line 913) only while jobs.status === 'error'. Neither retry path is covered in JobsView.spec.ts, even though the spec already stubs searchJobs/facetCounts. Suggest two tests: (a) retrying the facet rate-limit banner refreshes counts without reloading the list (searchJobs not called again, rows preserved); (b) retrying the list error re-requests the current page offset. Without them, a future retry surface where the list is healthy-but-stale would silently skip the reload.

@strelov1
strelov1 merged commit 291a822 into main Nov 14, 2026
43 of 45 checks passed
@strelov1
strelov1 deleted the fix/facet-quota-retry branch November 14, 2026 15:11
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