Resolve 8 conflicts:
- Accept upstream deletion of 3 composio_*_connector.py (unified Google connectors)
- Accept our deletion of ElectricProvider.tsx, use-connectors-electric.ts,
use-messages-electric.ts (replaced by Zero equivalents)
- Keep both new deps in package.json (@rocicorp/zero + @slate-serializers/html)
- Regenerate pnpm-lock.yaml
- Default to Docker service networking (http://frontend:3000) in both
compose files — works when all services run in Docker
- Add extra_hosts (host.docker.internal:host-gateway) for cross-platform
host access when running frontend outside Docker
- Document override examples in .env.example for local dev and
custom domain setups
Replaces 4 silent catch blocks with console.warn calls so sync
failures are observable in the browser console. Cleanup catches
at lines 147/155 stay silent since PGlite may already be closed.
Fixes#905
Wraps unguarded console.log statements in use-connectors-electric,
mcp-config-validator, and ElectricProvider behind an IS_DEV guard,
matching the existing pattern in lib/electric/client.ts. Keeps
console.error calls untouched so real errors still surface.
Fixes#904
- Create app/api/zero/query/route.ts — resolves named queries to ZQL
using handleQueryRequest and mustGetQuery from @rocicorp/zero
- Add ZERO_QUERY_URL to both docker-compose files:
- dev: http://host.docker.internal:3000 (reaches local Next.js from Docker)
- prod: http://frontend:3000 (Docker service networking)
Without this endpoint, zero-cache cannot resolve named queries and
no data syncs to the client.
Check information_schema before creating table to avoid
DuplicateTableError when table already exists from model metadata.
Original op.create_table preserved exactly, only skipped if exists.
Document that the Postgres user needs REPLICATION and CREATE privileges
for zero-cache. Docker setup handles this automatically (superuser), but
managed databases (RDS, Supabase, etc.) may need explicit grants.
- Fix timestamp conversion: String(epochMs) → new Date(epochMs).toISOString()
in use-messages-sync, use-comments-sync, use-documents, use-inbox.
Without this, date comparisons (isEdited, cutoff filters) would fail.
- Fix updated_at: undefined → null in use-inbox to match InboxItem type
- Fix ZeroProvider: skip Zero connection for unauthenticated users
- Clean 30+ stale "Electric SQL" comments in backend Python code
use-inbox: Keep all API calls (initial load, pagination, unread counts,
markAsRead/markAllAsRead optimistic updates). Replace Electric
sync+PGlite with Zero useQuery. Category filtering in JS. 458 → 273 lines.
use-documents: Keep all API calls (initial load, pagination, type counts,
user enrichment). Replace Electric sync+PGlite with Zero useQuery.
Remove baseline dedup. 511 → 361 lines.
All 7 Electric hooks are now rewritten to use Zero.
Keep all API calls (initial load, pagination, type counts, user
enrichment). Replace Electric sync+PGlite with Zero useQuery for
real-time deltas. Remove baseline dedup. 511 → 361 lines.
- Create how-to/zero-sync.mdx setup guide
- Update docker-compose.mdx with zero-cache service, env vars, troubleshooting
- Update dev-compose.mdx with Zero build arg
- Update install-script.mdx with zero-cache URL
- Update manual-installation.mdx with Zero frontend env var
- Add Zero sync page to how-to index, meta.json, and sitemap
- Replace Electric SQL references in postgresql.conf with Zero-cache
- Clean Electric SQL comments in chat-comments.types.ts and chat-messages.types.ts
- Add zero-cache service to docker-compose.yml and docker-compose.dev.yml
- Add ZERO_* env vars to docker/.env.example
- Add NEXT_PUBLIC_ZERO_CACHE_URL to surfsense_web/.env.example
- Add NEXT_PUBLIC_ZERO_CACHE_URL placeholder ARG/ENV to Dockerfile
- Add NEXT_PUBLIC_ZERO_CACHE_URL runtime substitution to docker-entrypoint.js
- Add NEXT_PUBLIC_ZERO_CACHE_URL build arg to docker-build.yml and desktop-release.yml
- Add rocicorp/zero:0.26.2 service with Postgres connection,
SQLite replica volume, healthcheck, and admin password
- Add NEXT_PUBLIC_ZERO_CACHE_URL to frontend env vars
- Frontend now depends on zero-cache health