Skip to content

fix(jobindex-search): ignore a jobannonce id that is not on the path - #763

Open
rudycelekli wants to merge 1 commit into
ai-job-search-dev:masterfrom
rudycelekli:fix/jobindex-detail-pathname
Open

rudycelekli wants to merge 1 commit into
ai-job-search-dev:masterfrom
rudycelekli:fix/jobindex-detail-pathname

Conversation

@rudycelekli

@rudycelekli rudycelekli commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

What changed and why

jobindex-search detail rebuilt 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. buildUrl now 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" }, so detail would fetch that posting. The same for https://jobindex.dk/jobsoegning?q=/jobannonce/r13677312 and https://www.jobindex.dk/#/jobannonce/h1647303.

detail calls buildUrl before htmlFetch. Those three inputs are now null, which the handler reports as BAD_ID and does not fetch.

Verification

In .agents/skills/jobindex-search/cli:

  • Before the fix, bun test tests/detail-input.test.ts failed on the new case and printed the rebuilt posting URL above.
  • After the fix, 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 install dependencies. 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 call buildUrl.

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.14 and then reports Response, URLSearchParams, Headers, and Request as values with no DOM members (TS2339), plus TS2749 on URL in untouched jobbank helpers.ts:165. Master’s last push CI, e16acee on 2026-10-21, was green. setup-bun is unpinned, so this is the current type package, not this pathname change.

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>
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