Skip to content

feat: app analytics - #8434

Open
fetchfern wants to merge 17 commits into
mainfrom
fetch/app-analytics
Open

fetchfern wants to merge 17 commits into
mainfrom
fetch/app-analytics

Conversation

@fetchfern

Copy link
Copy Markdown
Member

No description provided.

@github-actions

Copy link
Copy Markdown
Contributor

Pull request changelog

App

Added

Changed

Deprecated

Removed

Fixed

Security

Website

Added

Changed

Deprecated

Removed

Fixed

Security

Hosting

Added

Changed

Deprecated

Removed

Fixed

Security

@fetchfern
fetchfern added this pull request to stack #8451 November 25, 2026 00:04
@fetchfern
fetchfern marked this pull request as ready for review November 25, 2026 00:05
@mergify

mergify Bot commented Nov 25, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue). If it does not match the queue conditions yet, it enters the queue once it does.

  • Queue this pull request once it meets the queue conditions

@greptile-apps

greptile-apps Bot commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

security Security Review

This PR appears safe to merge from a security standpoint.

What was checked
  • The new ingest validator checks body size, event count, UUID versions, source, and app version before anything reaches ClickHouse, and the table DDL only uses config-supplied identifiers, not request data.
  • No HTTP route is wired to extract_events in this PR, so no new remotely reachable endpoint was added; the function is only called from tests.
  • The SDK's HTTP client keeps default TLS verification with 10-second timeouts, and its in-memory queue is capped at MAX_QUEUED_EVENTS, so failed sends can't grow memory without bound.
  • The Cargo.lock diff only adds the two new local packages; every advisory the scanner flagged is a version that was already in the lockfile before this PR.
  • Events the app queues while telemetry is opted out are normally dropped by the 10-second flush, but they can be sent after the user opts back in (reported below).

Findings

  • P2 Opted-out events sent after opt-in ▶
  • P2 Unbounded client strings reach ClickHouse ▶

@greptile-apps

greptile-apps Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The PR adds a bounded analytics path and database table for app events.

The new version check needs a coordinated update before merging because it breaks dependent PR #8450.

Reviews (2) · Last reviewed commit: "fix(analytics-types): loader_version and..." · Reviewed by Greptile

@fetchfern

Copy link
Copy Markdown
Member Author

@greptile

Comment on lines +181 to +185
if let AppEventType::InstanceStart {
game_version,
loader_version,
..
} = &event.event

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Dependent PR stops compiling

The new match breaks PR #8450 when it picks up these changes. That PR changes AppEventType::InstanceStart to contain only info: InstanceInfo, so this pattern can no longer match game_version and loader_version directly. Update this check alongside that shape change so the stacked PR still compiles.

Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/modrinth-app-analytics-types/src/http/extract.rs
Line: 181-185

Comment:
**Dependent PR stops compiling**

The new match breaks PR #8450 when it picks up these changes. That PR changes `AppEventType::InstanceStart` to contain only `info: InstanceInfo`, so this pattern can no longer match `game_version` and `loader_version` directly. Update this check alongside that shape change so the stacked PR still compiles.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Fix in Claude Code

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant