Operations
Limits, retention, security notes and the failure modes worth knowing about.
Limits
- Body size: 64 KiB by default (
BELLCAST_MAX_BODY_BYTES). - Title: 120 characters. Action buttons: 3 per message.
- Tags: 10 per message. Topic: 64 characters.
- History page: 200 messages. Long-poll hold: 25 seconds.
- Vercel serverless functions cap a request at 30 seconds — sync stays under it.
Retention
Messages older than BELLCAST_RETENTION_DAYS (default 30) are deleted by the daily prune cron. The reset flag in a sync response tells a client its cursor fell behind retention, so it should drop its cache and reload.
Back up the database if messages matter to you. Supabase's own backups cover the whole project; a logical export of the messages table is enough for Bellcast.
Security
- The service role key and
BELLCAST_API_KEYare server-only. Never prefix them withNEXT_PUBLIC_. - RLS is on with no policies; API roles cannot read the table directly.
- Session cookies are HttpOnly and SameSite=Lax, and are only set after a valid key.
- Publish accepts CORS requests by design. Anyone with the key can publish; rotate it if it leaks.
- Keep the deployment on HTTPS. Connect links contain the key in the fragment and should not be logged or shared.
Troubleshooting
- Health says not configured — one of
SUPABASE_URL,SUPABASE_SERVICE_ROLE_KEYorBELLCAST_API_KEYis missing in the deployed environment. - 401 on every request — the key in the client differs from the deployed
BELLCAST_API_KEY. Sign out and back in. - Messages stop arriving — check that the client is looping on
/api/v1/syncand that the deployment is not asleep. Serverless cold starts add a second or two to the first poll. - No desktop notifications — confirm the app is running (tray icon) and allowed to notify in system settings; the window being closed is fine.
- Prune returns 401 —
CRON_SECRETis missing or the caller is not sending it as a bearer token.