mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #3896] [CLOSED] [Engine] Opt-in error reporting for the server process (inert without a DSN) #4820
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#4820
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/3896
Author: @Faks
Created: 10/24/2026
Status: ❌ Closed
Base:
main← Head:feat/error-reporting-upstream📝 Commits (1)
46728ae[Engine] opt-in error reporting for the server process (inert without a DSN)📊 Changes
5 files changed (+155 additions, -5 deletions)
View changed files
📝
README.md(+2 -1)📝
docs/SAFETY.md(+8 -4)➕
serve/error_reporting.py(+56 -0)📝
serve/server.py(+4 -0)➕
tests/terminal/test_error_reporting.py(+85 -0)📄 Description
Problem and result
handle_errorinserve/server.pyprints a traceback and continues, so a request-path failure stops there and nothing reaches an error tracker. Withserve/error_reporting.pythe server reports failures that reach the handler boundary, and only when a DSN is set. With no DSN the module does nothing at all, and the extra package is not installed by setup.The privacy page had to change too, because the change makes its headline claim false. docs/SAFETY.md says "There is no telemetry. Strata sends no usage data, no crash reports and no analytics", and its "Does Strata phone home?" answer says a search of the code found no crash reporter. Once an opt-in reporter exists, that sentence is no longer true as written, so both are qualified to the default path, and the internet table gains the row for it — the table claims to list what was found in the code, and leaving this out would make it incomplete.
Related discussion
None. No issue was opened and no maintainer agreement on scope was sought before writing this. CONTRIBUTING asks for scope agreement on features; this is one, so a maintainer may reasonably ask for an issue first or return the PR.
Approach
STRATA_GLITCHTIP_DSNor fromerror_reporting.dsnin the run config, matching how the server already reads optional settings.sentry-sdkis not added torequirements.txt. That file is the pinned installsetup.pyruns for every user, and CONTRIBUTING keeps dependency changes out of a PR; a dependency serving an opt-in feature would become a hard requirement for everyone. The import is guarded, so a missing package prints one line and the server starts anyway.send_default_piistays off and tracing stays off: the report is about the failure, not the request content.STRATA_GLITCHTIP_DSN) while the SDK is Sentry-compatible and works against any Sentry-compatible tracker. A neutral name such asSTRATA_ERROR_REPORTING_DSNmay be preferred by maintainers. It is kept as written because that is what the deployment running this already uses.Validation
Passed:
python3 -m pytest tests/terminal/test_error_reporting.py -q→6 passedon46728ae5, Linux, Python 3.13. Unit tests with the SDK mocked, no network, no GPU: inert without a DSN, DSN from the run config, missing package prints one line and does not stop a start, active with environment and release taken, capture needs an active client, a hang-up is not reported.import serve.serverwith the new module: clean;init()returnsFalsewith no DSN.skippedfor email recipients because that is hardcoded — apps/alerts/api.py line 179 — so a skipped test is the endpoint refusing to test email, not a broken alert. Email recipients are resolved as users on a team holding the project with aUserProjectAlertrow orsubscribe_by_default— apps/users/models.py line 44.Failed:
Not run:
pytest, and the system Python that has it lacksrich(9 collection errors). That is an environment limit, not a result for this change.400, so nothing raised to the boundary.Limits
serve/server.pyhas 241exceptsites, 63 of which pass, continue or log only. A handler that keeps its exception reports nothing, so a quiet tracker does not mean a watchful one. Many of those swallows are deliberate — a failed check must not stop a start — so widening coverage is a design decision, not part of this change.sentry-sdkis installed by hand it is not inrequirements.txt, so a venv rebuild loses it and the module then only prints a failure line.apps/host/src/components/PrivacyNotes.tsx: "Strata sends no usage telemetry") covers usage, not failures. It is left unchanged here because UI text is outside this change; if the note should carry the exception, that is a separate edit.Disclosure
Prepared by Gnarl, the Operator's agent, at his instruction, on this account. AI-assisted work; every changed line is his own reading, and the numbers above are measured, not estimated. Two claims that were wrong during this work were corrected rather than left standing: an alert read as undeliverable from a hardcoded
skipped, and a probe read as a failure because the tracker was queried before asynchronous delivery completed.The commit is authored and committed under this account. Internal hosts and the DSN are kept out of this body and out of the code; the DSN lives in a private env file, mode 600.
Tracker: https://glitchtip.com/ · SDK: https://pypi.org/project/sentry-sdk/
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.