Skip to content

feat(reporting): send reports and usage events to OpenNOW Reports - #1096

Merged
zortos293 merged 2 commits into
capy/add-opt-out-automaticfrom
capy/send-reports-and-usage
Oct 4, 2026
Merged

zortos293 merged 2 commits into
capy/add-opt-out-automaticfrom
capy/send-reports-and-usage

Conversation

@zortos293

Copy link
Copy Markdown
Collaborator

This is stacked on #1092. It moves the desktop client from the PrintedWaste bug-report endpoint and the direct PostHog capture to OpenNOW's own report service (opennow-reports). That service stores reports and forwards allowlisted usage events to PostHog.

Core (native/opennow-core)

  • reports.rs replaces telemetry.rs.
    • Reports are sent to {base}/v1/reports as multipart: a report JSON part (schema v1) and an optional gzip log part.
    • The base URL is DEFAULT_REPORTS_API (https://reports.opennow.app, placeholder until the domain is final). It can be overridden with OPENNOW_REPORTS_API.
    • Manual reports, automatic reports and feedback.submit all go through it. Feedback is sent as a manual report without an account.
    • Retryable failures are kept in <data_dir>/reports/pending/: at most 5 reports, at most 7 days old. They are retried after the next sign-in.
  • analytics.rs:
    • Events are held in a bounded queue of 1,000 (oldest dropped first) and batched to {base}/v1/events: every 30 s, at 50 events, and at shutdown with a 1 s budget.
    • Failed batches are written to a 1 MB JSONL spool.
    • The event allowlist and property validation live in Rust.
    • The core emits app_opened, signed_in, game_launch_requested, session_error, library_load_failed, bug_report_sent and consent_changed. consent_changed is sent anonymously.
    • Turning consent off wipes the queue, the spool, pending reports and any batch in flight.
  • New analytics.track RPC for shell-emitted events. The capability is now automaticBugReports.v2, and docs/core-protocol.md is updated.
  • Removed: the telemetry.sync RPC, the PrintedWaste upload, termsAccepted, the reporter hash, and the client-side PostHog key.
  • Account identity: bug_report_identity now also returns userId and providerIdpId. The backend turns these into a pseudonymous player ID; they are never written to diagnostics.
  • Migration: a legacy errorReportingConsent: "denied" with an unanswered automaticBugReports becomes "disabled".

Shell (QML)

  • Session events: BugReportState emits session_started (on first frame) and session_ended (once per session, with outcome clean/user_stopped/remote_ended/error). session_ended includes average FPS, ping and packet loss, computed from the existing telemetry samples. It also emits frame_drops_detected and stream session_errors.
  • Toast: shows REF <reportId>. When the service is already investigating the issue, it says "The developer's assistant is looking into it." A send that fails and is queued says it will be retried the next time OpenNOW starts.
  • Consent wording: now "Usage & bug reports" across the sign-in notice, the first-run sheet, the settings rows and the console sign-in. The legacy "Crash reports"/"Error reporting" toggles are removed. Only locales/en.json changed.

Verification

  • cargo test --manifest-path native/opennow-core/Cargo.toml --locked: all pass. New tests cover the allowlist, queue overflow and batching, the spool cap and resend, the consent wipe (including an in-flight batch), the multipart and gzip body against a mock server, retryability, pending-report pruning, and the consent migration.
  • cargo fmt --check and cargo clippy --all-targets are clean. npm run locales:check passes.
  • ctest (Linux/xvfb): 403/403. qml-bug-reports now checks the analytics.track calls, the averaged stats, opt-out silence and the toast copy.
  • Wire format: the payloads were captured from the real core binary. I checked them against the backend's schema and allowlist, and aligned the backend's store/game_id rules with them.
  • Not verified: the new copy hasn't been looked at in a running UI beyond the offscreen acceptance test.

Before merging, set DEFAULT_REPORTS_API to the deployed backend URL.

Open in Capy

@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 45e51e9e-8dbc-4757-8d27-2e07b7f8d245

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@zortos293
zortos293 merged commit 8f6285e into capy/add-opt-out-automatic Oct 4, 2026
4 checks passed
capy-ai Bot pushed a commit that referenced this pull request Oct 4, 2026
* feat(reporting): add opt-out automatic bug reports

* feat(reporting): send reports and usage events to OpenNOW Reports (#1096)

* feat(reporting): send reports and usage events to OpenNOW Reports

* fix(reporting): point the client at the deployed reports service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant