Repository navigation
fix(jobindex-search): ignore a jobannonce id that is not on the path - #763
Open
rudycelekli wants to merge 1 commit into
Open
rudycelekli wants to merge 1 commit into
rudycelekli wants to merge 1 commit into
Conversation
A search or redirect URL on jobindex.dk was fetched as the posting whose id appeared only in the query or fragment. Co-authored-by: Cursor <cursoragent@cursor.com>
jakob1379
self-requested a review
November 9, 2026 06:02
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed and why
jobindex-search detailrebuilt a fetch URL from the first/jobannonce/<id>anywhere in the raw string. A jobindex URL that is not a posting — a search page or a redirect whose id sits only in the query or fragment — was fetched and returned as that posting.Jobbank and jobnet already reject a job path that is not on the pathname.
buildUrlnow does the same: the host is still checked, and the id has to be the/jobannonce/<id>path segment. A real posting URL, including one with a title slug or a tracking query, still becomes the canonical jobannonce URL. Bare ids are unchanged.Failing case / reproduction (for fixes)
On master,
buildUrl("https://www.jobindex.dk/?next=/jobannonce/h1647303")returned{ url: "https://www.jobindex.dk/jobannonce/h1647303", id: "h1647303" }, sodetailwould fetch that posting. The same forhttps://jobindex.dk/jobsoegning?q=/jobannonce/r13677312andhttps://www.jobindex.dk/#/jobannonce/h1647303.detailcallsbuildUrlbeforehtmlFetch. Those three inputs are nownull, which the handler reports asBAD_IDand does not fetch.Verification
In
.agents/skills/jobindex-search/cli:bun test tests/detail-input.test.tsfailed on the new case and printed the rebuilt posting URL above.bun test tests/detail-input.test.ts tests/detail-parsing.test.ts— 18 pass, 0 fail.python3 -m unittest tests.test_changelog_structure— ok.The full CLI suite needs the real
bun installdependencies. That install did not fit on this disk (no space left while extracting the bunli tree), so flag-parsing tests were not re-run here. They do not callbuildUrl.CI
Python 3.10–3.14, Windows, lint, security guards, LaTeX, and dependency review passed.
The four CLI typecheck jobs fail on this pull request and on #764, including
jobbank-search, which neither pull request edits. The log installs@types/bun@1.3.14and then reportsResponse,URLSearchParams,Headers, andRequestas values with no DOM members (TS2339), plusTS2749onURLin untouchedjobbankhelpers.ts:165. Master’s last push CI,e16aceeon 2026-10-21, was green.setup-bunis unpinned, so this is the current type package, not this pathname change.