Skip to content

fix(collect): actually clear collectUrl when switching to non-Seek source#9

Merged
karlorz merged 654 commits intomasterfrom
feat/51job-dev
Mar 31, 2026
Merged

fix(collect): actually clear collectUrl when switching to non-Seek source#9
karlorz merged 654 commits intomasterfrom
feat/51job-dev

Conversation

@karlorz
Copy link
Copy Markdown
Owner

@karlorz karlorz commented Mar 31, 2026

Summary

  • handleCollectionSourceChange was calling setSessionCollectUrl with an updater function whose condition (current ?? undefined) === current is always true for any string or undefined — making it a no-op that never cleared the stale URL
  • Replaced with setSessionCollectUrl(undefined) so switching to a non-Seek source (Job5156, 51job) reliably discards any previously stored collectUrl

Test plan

  • cd apps/web && npx tsc --noEmit — no type errors
  • npm test -- --run src/hooks/useResumeListState.test.tsx — 50/50 pass
  • make check — all checks pass
  • Manual: open a Search Profile, ensure 51job eHire is the only enabled source, click Run Now → confirm it opens https://ehire.51job.com/... not a stale Job5156 URL

karlcc added 30 commits March 18, 2026 02:17
karlcc and others added 29 commits March 27, 2026 21:15
* fix: add quick-start-only search profiles view

* fix: point migration banner to quick-start view
* fix: add quick-start-only search profiles view

* fix: point migration banner to quick-start view

* fix: correct virtualized search result offset
Co-authored-by: karlcc <3255660+karlcc@users.noreply.github.com>
…urce

The updater (current) => (current ?? undefined) === current ? current : undefined
was tautological — the condition is always true for any string or undefined, so
the stale collectUrl was never cleared on source switch. Replace with a direct
setSessionCollectUrl(undefined) call.
@karlorz karlorz merged commit 0d0a2d6 into master Mar 31, 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.

2 participants