fix(frontend): skip crawl-job lookup for non-crawl documents
Problem
Clicking a regular uploaded document in the web document library logged a 404 and showed a user-facing error toast:
Failed to load resource: the server responded with a status of 404 (Not Found)
httpService.js:225 API response error
documentFileService.js:200 Error fetching crawl job for file <id>
Root cause
FileDetailsDialog.fetchData() called documentFileService.getCrawlJob(id) unconditionally for every file. Regular uploads have no crawl_job row, so the backend returns 404 { error: "Crawl job not found" }. That 404 flows through httpService's global response-error interceptor, which fires notificationService.error(...) for every non-401 error — the visible toast — plus console noise. fetchData's own try/catch silently swallowed the rejection, but only after the toast had already fired.
The Flutter mobile app is unaffected — it makes no crawl-job calls.
Fix
Two complementary, low-risk changes (default behaviour for all other callers unchanged):
-
Gate the
getCrawlJobcall onsource_url(FileDetailsDialog.vue).source_urlis empty for regular uploads and a URL for link/crawl-origin files, so the request is now skipped entirely for non-crawl documents — eliminating the 404, the toast, and the console noise for the reported case. -
Opt-in
{ silent: true }onhttpService(httpService.js) — suppresses the user-facing error toast when a non-success response is an expected, handled outcome (rejection + console log still occur). Applied to the crawl-job/metrics/logs lookups as defence-in-depth for crawl-origin files whose job is absent.
Tests
-
FileDetailsDialog: gating —getCrawlJobnot called whensource_urlempty/null; called when set. -
documentFileService:getCrawlJob/getCrawlMetrics/getCrawlLogspass{ silent: true }. -
httpService: error interceptor shows the toast by default, suppresses it whenconfig.silentis true.
Full frontend suite: 1228 tests pass (1223 baseline + 5 new). eslint src/ and prettier --check clean.