mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-07-23 12:24:55 +00:00
Per Playwright's own docs, routeFromHAR's notFound: 'fallback' sends unmatched requests straight to the network -- it does not chain to other, earlier-registered page.route() handlers via route.fallback() the way I'd assumed. Since Playwright checks routes in reverse-registration order, a handler registered in beforeEach (i.e. before the test body's routeFromHAR call) is checked AFTER routeFromHAR, whose catch-all pattern intercepts everything first and sends any miss straight to the (nonexistent, in e2e) network -- my stub never got a chance to run. Confirmed by a second CI failure with the same "Failed to fetch" symptom even after the CORS-header fix. Moved the mockFilterSelectionData(page) call to immediately after each test's own routeFromHAR(...) call instead, so it's registered later and checked first for that specific URL, with routeFromHAR's broader pattern still handling everything else as before. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>