Crash reports
When something breaks for someone, Hatch can send a short report so we can fix it. Reports are off until a DSN is set, and then still off for each person until they turn on Send crash reports in Settings, Privacy. Each report checks the switch first, so turning it off stops reports at once. The desktop app keeps the choice in main's hatch.json and the window asks main for it, so there is one copy. The web and mobile apps keep it in the device's local settings. They never hold anything from the person's notes. Hatch collects no usage data or analytics.
The code is packages/errors. It has no dependencies and adds about 2 KB (gzipped) to the app when turned on, and nothing when off.
What a report holds
- The error's type and message. Quoted text, paths, file names, email addresses and the path and query of URLs are taken out first. Our own errors quote file names (
"Plans.md" already exists), so they come out too. - The stack: file, function name, line and column. Home folders are taken out of file paths.
- Where it happened:
web,desktop,desktop-main,mobileorserver. For the server, the route pattern (/api/sites/:id) and method, never the real path. - The release and environment, if set.
Never: note text, file names, the page URL, cookies, headers, breadcrumbs, user ids, IP addresses (reports ask the receiver not to keep one) or the machine's name. When something other than an Error is thrown, only its kind is sent (A string was thrown), since its text could be anything.
Each run sends at most 20 reports, and the same error only once. Browser noise (extensions, ResizeObserver loop, cross-origin Script error.) is dropped.
Where reports go
Reports use the Sentry protocol, so any of these work with no code change:
Create a project there (platform: JavaScript, or Node for the server) and copy its DSN. It looks like https://<key>@<host>/<project id>. A DSN is not a secret: it only lets someone send reports.
In Sentry, also turn on Prevent Storing of IP Addresses in the project's Security and Privacy settings.
Turning it on
| Where | Variable | When it's read |
|---|---|---|
| Web app | VITE_HATCH_ERROR_DSN | At build time. With Docker: the HATCH_ERROR_DSN build arg (deploy/docker-compose.yml passes it from deploy/.env). |
| Desktop app (window and main process) | VITE_HATCH_ERROR_DSN | At build time. The release workflow reads the HATCH_ERROR_DSN repository secret. |
| Mobile app | VITE_HATCH_ERROR_DSN | At build time |
| Server | HATCH_ERROR_DSN | At start. deploy/docker-compose.yml passes it from deploy/.env. |
Optional: VITE_HATCH_RELEASE (apps) and HATCH_RELEASE (server) name the version, so you can see when an error stops. The desktop app uses its own version when unset, and the release workflow sets it from the tag.
One DSN for everything works. Two projects (one for the apps, one for the server) keep them apart.
How it catches errors
- Apps: uncaught errors and unhandled promise rejections on the page. React 19 passes render errors nobody caught to the window, so those are included.
- Server: every request that ends in a 500, plus uncaught errors. After an uncaught error the server reports it and exits, as Node would have, so Docker restarts it.
- Desktop main process: uncaught errors and unhandled rejections. Electron's own handling is kept.
Community plugins run in sandboxed frames, so their errors are never reported.
Not done yet
Stacks from the built app are minified. Uploading source maps to the receiver at release time would make them readable. It needs an auth token in CI, so it waits until reports are flowing.