TT-4712 user and country analytics by year/month#321
Open
sarahentzel wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds monthly/yearly login analytics tracking to the renderer and introduces corresponding Orbit models and a DB migration to support user- and country-level aggregation.
Changes:
- Trigger a login analytics “track” request during online initialization (
Sources.tsx). - Add Orbit schema models and TypeScript record types for
useranalyticsandcountryanalytics. - Add a SQL migration creating
useranalyticsandcountryanalyticstables with unique (dimension, year, month) constraints.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/renderer/src/Sources.tsx | Calls logLoginAnalytics after remote activation to record an online login. |
| src/renderer/src/schema.tsx | Bumps schema version to 11 and registers useranalytics/countryanalytics models. |
| src/renderer/src/model/userAnalytics.tsx | Adds Orbit record typing for user monthly analytics. |
| src/renderer/src/model/countryAnalytics.tsx | Adds Orbit record typing for country monthly analytics. |
| src/renderer/src/model/index.tsx | Exports the new analytics model types. |
| src/renderer/src/crud/logLoginAnalytics.ts | Adds API helper to POST the login tracking event. |
| src/renderer/src/crud/index.ts | Re-exports logLoginAnalytics from the CRUD barrel. |
| migration/r4.4/analytics.sql | Creates useranalytics and countryanalytics tables and grants privileges. |
gtryus
approved these changes
May 21, 2026
| try { | ||
| await axiosPost('useranalytics/track', undefined, token); | ||
| } catch (error) { | ||
| console.error('logLoginAnalytics', error); |
Contributor
There was a problem hiding this comment.
if you use logError, this would post to bugsnag. Do you want failures posted to bugsnag?
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.
No description provided.