Skip to content

fix(worker): correct SWS translation for headers, SPA fallback, and sources - #104

Open
Dvorinka wants to merge 1 commit into
mainfrom
fix/sws-static-config
Open

Dvorinka wants to merge 1 commit into
mainfrom
fix/sws-static-config

Conversation

@Dvorinka

Copy link
Copy Markdown
Owner

Summary

Three SWS (static-web-server) config bugs found during the Vercel estate migration — every fix is verified live on the waw instance running a v1.1.3 image built from this branch:

  • Headers TOML shape — SWS 2.x rejects the emitted [[headers]] shape; translated to the form SWS accepts.
  • SERVER_PAGE_FALLBACK ignored — SWS 2.x no longer honors the env var; SPA fallback now emitted as a proper page_fallback config entry (verified: /login on bookrademo returns the shell).
  • regex→glob source translation — source patterns emitted in regex form; converted to glob semantics SWS matches on.

Without this, static deploys either crash SWS at startup or serve 404s on deep links — i.e. every SPA in the estate breaks in exactly the way Vercel users expect to work.

Test plan

  • Live on waw-ovh-vps runway v1.1.3 (image built from this branch): 13/13 estate projects serve 200; bookrademo + bookra-frontend SPA fallback on /login verified; relay-landing custom headers verified.
  • Unit coverage of the translation — worth a follow-up; the estate deploys are the regression test until then.

Generated with Devin

…ources

Three vercel.json→static-web-server translation bugs broke static
deploys that set headers, rewrites, or SPA fallback:

- headers emitted [[advanced.headers.headers]] arrays of {key,value}
  pairs; SWS expects a single [advanced.headers.headers] name→value map
- SERVER_PAGE_FALLBACK env is ignored by SWS 2.x; the fallback only
  takes effect via the config file, so emit it whenever spa_fallback
  is set
- SWS `source` patterns are globs, not Vercel regex — "/(.*)" now
  translates to "/**" for headers, rewrites, and redirects

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@mira-tdvorak

mira-tdvorak Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Mira PR Walkthrough

This PR fixes the worker's translation of static site deployment configuration into a valid static-web-server (SWS) configuration. It corrects the headers TOML structure, emits SPA fallback as a page_fallback setting because the environment variable is ignored by SWS 2.x, and converts regex source patterns to glob syntax. The changes were verified live across 13 estate deployments, though dedicated unit coverage remains a follow-up.

Confidence: 4/5   ◉◉◉◉○   Safe to merge
  • The fix is narrowly scoped, directly addresses SWS 2.x incompatibilities, and has been verified live across the affected estate deployments; the only gap is the deferred unit-test coverage.

❌ Review failed — click for details

The code review failed to complete due to an unexpected error.

Stage: Code review
Error type: LLMError
Message: Both primary and fallback models failed


Comment @mira-tdvorak help to get the list of available commands and usage tips.

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