Skip to content

Return empty search result when providers return no jobs (remove mock example jobs)#7

Merged
joelnishanth merged 1 commit into
mainfrom
codex/investigate-example-domain-page-issue
May 5, 2026
Merged

Return empty search result when providers return no jobs (remove mock example jobs)#7
joelnishanth merged 1 commit into
mainfrom
codex/investigate-example-domain-page-issue

Conversation

@joelnishanth
Copy link
Copy Markdown
Owner

Motivation

  • Users were being taken to https://example.com/... when clicking Apply because the search service generated mock jobs with example URLs when all providers returned no results.
  • The intended behavior for a true no-results scenario is to show an empty/no-results UI state, not synthetic job cards with external links.

Description

  • Remove the generateMockResults fallback and related mock job data from both apps/extension-chrome/src/shared/job-search-service.ts and apps/extension-firefox/src/shared/job-search-service.ts.
  • Change searchJobs to return an explicit empty JobSearchResult (jobs: [], totalResults: 0, page: filters.page ?? 1, totalPages: 0) and cache that empty result when upstream providers yield no jobs.
  • Preserve existing behavior for non-empty responses and keep caching/deduplication logic intact.

Testing

  • Verified the code change by searching the codebase for the mock generator and example URLs with rg -n "generateMockResults|example.com/job", confirming removal of mock entries.
  • Confirmed the new empty-result branch is present in both modified files by inspecting the updated source (apps/extension-chrome/src/shared/job-search-service.ts and apps/extension-firefox/src/shared/job-search-service.ts).
  • Attempted to run the repository tests with npm --prefix apps/extension-chrome run -s test -- src/popup/popup.test.ts, but the test runner failed in this environment because vitest is not available, so unit tests were not executed here.

Codex Task

@joelnishanth joelnishanth merged commit 6179317 into main May 5, 2026
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant