Skip to content

Fix jobs detail navigation race#504

Merged
bgentry merged 1 commit intomasterfrom
bg/fix-jobs-route-redirect-loop
Feb 6, 2026
Merged

Fix jobs detail navigation race#504
bgentry merged 1 commit intomasterfrom
bg/fix-jobs-route-redirect-loop

Conversation

@bgentry
Copy link
Contributor

@bgentry bgentry commented Feb 5, 2026

On slower connections, opening a job from a filtered jobs list could bounce back to /jobs/. JobSearch was re-emitting debounced filter updates on unrelated rerenders, and the jobs route treated those callbacks as replace navigations even when search params were unchanged. That could override an in-flight transition to /jobs/$jobId.

The filter parser result is now memoized in useFilterInput so onFiltersChange is not retriggered when input text has not changed. The jobs route now compares derived filter search params against current params and skips navigation when the update is a no-op.

A regression test was added to JobSearch to ensure an unrelated rerender does not notify the parent of filter changes.

Closes #495.

@bgentry bgentry added the bug Something isn't working label Feb 5, 2026
@bgentry bgentry force-pushed the bg/fix-jobs-route-redirect-loop branch from 9400251 to 2e9e996 Compare February 6, 2026 00:02
@bgentry bgentry requested a review from brandur February 6, 2026 00:06
@bgentry
Copy link
Contributor Author

bgentry commented Feb 6, 2026

wooo, a user confirmed this fixes it: #495 (comment)

Copy link
Collaborator

@brandur brandur left a comment

Choose a reason for hiding this comment

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

Cool. Really nice to get this fixed up!

On slower connections, opening a job from a filtered jobs list could
bounce back to /jobs/. JobSearch was re-emitting debounced filter updates
on unrelated rerenders, and the jobs route treated those callbacks as
replace navigations even when search params were unchanged. That could
override an in-flight transition to /jobs/$jobId.

The filter parser result is now memoized in useFilterInput so
onFiltersChange is not retriggered when input text has not changed. The
jobs route now compares derived filter search params against current
params and skips navigation when the update is a no-op.

A regression test was added to JobSearch to ensure an unrelated rerender
does not notify the parent of filter changes.

Closes #495.
@bgentry bgentry force-pushed the bg/fix-jobs-route-redirect-loop branch from 2e9e996 to 9fc0177 Compare February 6, 2026 15:56
@bgentry bgentry enabled auto-merge (squash) February 6, 2026 15:56
@bgentry bgentry merged commit 47c8357 into master Feb 6, 2026
21 checks passed
@bgentry bgentry deleted the bg/fix-jobs-route-redirect-loop branch February 6, 2026 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

First click on job in jobs list doesn't navigate to detail page

2 participants