Repository navigation
fix(claw-server): give the Sentry client a transport so run failures are sent - #2907
Merged
Merged
Conversation
…are sent SentrySink built its client with `sentry::Client::from_config` and bare default options. Only `sentry::init` / `apply_defaults` installs the HTTP transport, so the client held a valid DSN, reported itself disabled, and `SentrySink::new` returned `None` for every build. Released servers with the DSN compiled in therefore fell back to the local `run-failures.log` and the neo-server Sentry project never received an event. Set the transport factory explicitly rather than calling `apply_defaults`, which would also read ambient env (`SENTRY_DSN`, proxies, `SSL_VERIFY`) and attach integrations that this module deliberately avoids. A DSN that still yields no client now logs a warning instead of reading as the routine "no DSN" case, and a regression test asserts that an envelope reaches a local stand-in for the ingest endpoint.
Contributor
|
Contributor
✅ Tests passed: 1081/1081Ran 3 of 16 suites (13 not affected by this change).
|
A single TcpStream::read may return only part of the request line, which would fail the assertion even when the envelope was sent correctly. Read through the first newline with a read timeout instead.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Released BrowserOS neo servers have the Sentry DSN compiled in, but the client was built without a transport, so it never sent anything. The release workflow was passing the secret correctly; the bug is in
SentrySink::new.Only
sentry::init/apply_defaultsinstalls the default transport. The factory is set explicitly instead of callingapply_defaults, which would also read ambient env (SENTRY_DSN, proxies,SSL_VERIFY) and attach integrations this module avoids. A DSN that still yields no client now logs a warning rather than reading as the routine "no DSN" case.Evidence
Before: the new test fails on
main, and the shipped 0.0.69 binary (DSN embedded) writes~/.browserclaw/logs/run-failures.log.*every day instead of sending.After: the envelope reaches a local stand-in for the ingest endpoint.
End to end (throwaway probe, not committed): a failing
runthrough the realAppStatewiring withCLAW_SENTRY_DSNset.Before: no request;
run-failures.log.2026-10-13written instead.After:
POST /api/1/envelope/carrying only the redacted payload:TLS: the same client options reach Sentry's real ingest host over HTTPS (bogus key, rejected by Sentry as expected).
Full
cargo test --package claw-server --locked,cargo fmt --checkandcargo clippy --all-targets -- -D warningspass.Merge Danger
Door: two-way. Reverting restores the local-log fallback.
Blast Radius:
runcalls are sent, only with analytics consent, capped at 10 per install per day, so Sentry quota starts being used.reqwestclient and starts a background transport thread at server startup; thesentrycrate panics there if no TLS backend is available. It builds with the lockedrustls/ringset.run-failures.log.🤖 Generated with Claude Code