Closes https://github.com/webstudio-is/webstudio/issues/5877
Closes https://github.com/webstudio-is/webstudio/issues/4775
- Organize assets into nested folders.
- Navigate folders with breadcrumbs and Back controls.
- Select and manage multiple assets and folders at once.
- Drag, copy, cut, paste, duplicate, move, and delete items.
- Use context menus and familiar keyboard shortcuts for common actions.
- Search and sort assets and folders, with folders grouped first.
- Upload files directly into the active folder.
- Manage folder placement from asset and folder settings.
- Automate asset and folder management through MCP.
## Description
`builder_backend_wait_for_db` checks readiness by running `psql` inside
the `db` container, which connects over the **unix socket**. The
official `postgres` image's entrypoint starts a temporary server with
`listen_addresses=''` (socket only) while it runs its init phase. During
that window the socket probe succeeds, but host-side clients (prisma
migrate, postgrest) connecting over TCP still get `connection refused` .
so the wait can return before the database is actually reachable.
It's a timing race: it rarely bites with a fast init, but it's
reproducible with slower images/machines (we hit it consistently in our
fork's CI, which uses a pg image with a longer init phase).
Fix: make the readiness probe connect the same way real clients do. Over
TCP (`psql -h 127.0.0.1`). `PGPASSWORD` is needed because host
connections use password auth, unlike the socket which is `trust`.
Same one-line change to the probe in `builder_backend_wait_for_db`;
behavior is otherwise identical.
## Steps for reproduction
1. `docker compose down -v` in `apps/builder` (force a fresh initdb)
2. run `dev/run-local.sh` (or anything using
`builder_backend_wait_for_db`)
3. on a slow machine the wait returns during the init phase and the
following `prisma migrate` / postgrest startup fails with `connection
refused`; with this patch the wait only returns once TCP is accepting
connections
## Code Review
- [ ] hi @kof, I need you to do
- detailed review (it's a one-line probe change in `dev/backend.sh`)
## Before requesting a review
- [x] made a self-review
- [x] added inline comments where things may be not obvious (the "why",
not "what")
## Before merging
- [ ] tested locally and on preview environment (preview dev login:
0000)
- [ ] updated test cases document n/a (dev tooling only)
- [ ] added tests -> n/a (shell dev script)
- [x] if any new env variables are added, added them to `.env` file ->
none added
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>