fix(bridge): revert invalid /.netlify/* redirect; keep defense-in-depth check
PR #206 review found Netlify rejected the previous commit's `[[redirects]] from = "/.netlify/functions/*"` rule with "Invalid /.netlify path in redirect source" — the namespace is reserved and cannot appear as a redirect source. This rejection is intentional and matches the docs:
> https://docs.netlify.com/routing/redirects/redirect-options/#shadowing > Direct calls to `/.netlify/functions/<name>` are excluded from user > redirects, including `force = true` catch-all rules.
Which means the original "redirect was hijacking the kickoff URL" hypothesis was wrong — that path is auto-exempt, so the catch-all was never the cause.
Changes vs the previous commit on this branch: - deploy/bridge/netlify.toml: remove the rejected passthrough rule and rewrite the comment to document Netlify's auto-exemption + cite the docs link, so a future agent does not re-attempt the same invalid pattern. - hub/bridge/server.mjs: rewrite the `kickOffBackgroundIndex` comment to enumerate the actual failure modes the response-status check guards against (function not deployed, wrong host header, HMAC misconfig, future routing bug). - test/bridge-index-auto-routing-contract.test.mjs: replace the ordering-of-passthrough-rule test with a regression guard that asserts NO redirect rule's `from` starts with `/.netlify` — preventing anyone (including future agents) from re-introducing the rejected pattern.
The defense-in-depth response-status validator (`lib/bridge-index-kickoff-response.mjs`) remains the entire fix. Any non-202 response from the kickoff fetch will now throw, the existing catch handler will release the lock, and the UI will surface a real 502 with diagnostic detail (HTTP status + truncated body) instead of false success — which is what we need to identify the actual root cause of the original "Large re-index started, but no work runs" symptom on the user's next attempt.
Tests: 1893 / 1892 pass / 0 fail / 1 skipped (unchanged from prior commit).
0 comments
muse hub commit comment sha256:9e6c975c38acc1c31c3de554f6ef9551c7a1f579fd4fc20add186040dde823c7 --body "your comment"
No comments yet. Be the first to start the discussion.