Skip to content

Comments

fix: track streak_10 in analytics (was streak_7)#222

Merged
mholzi merged 1 commit intomainfrom
fix/188-streak10-analytics
Feb 20, 2026
Merged

fix: track streak_10 in analytics (was streak_7)#222
mholzi merged 1 commit intomainfrom
fix/188-streak10-analytics

Conversation

@mholzi
Copy link
Owner

@mholzi mholzi commented Feb 20, 2026

Root Cause

scoring.py and state.py correctly tracked/exported streak_10_count, but analytics.py and stats.py were still reading streak_7_count — a key that no longer exists. Every streak-10 achievement silently dropped to zero in all aggregation.

Changes

File Change
analytics.py streak_7_countstreak_10_count in TypedDict + compute_streak_stats()
services/stats.py Read streak_10_count from game summary
server/views.py Align _VERSION with manifest.json ("2.6.0-dev" → "2.6.0")

Note: scoring.py (condition == 10) and state.py (exports streak_10_count) were already correct.

Testing

Existing unit tests cover streak scoring. Analytics aggregation: after this fix, games where a player hits 10 consecutive correct answers will correctly appear in streak stats.

Closes #188

- analytics.py: rename streak_7_count → streak_10_count in TypedDict,
  compute_streak_stats() aggregation and return value
- services/stats.py: read streak_10_count from game summary
- server/views.py: align _VERSION with manifest.json (2.6.0)

scoring.py and state.py were already correct (streak_10).
The mismatched key caused streak-10 to silently drop in all
analytics aggregation.

Fixes #188
@gemini-code-assist
Copy link

Summary of Changes

Hello @mholzi, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a critical bug in the analytics and statistics tracking system where achievements for reaching a 10-game streak were not being correctly aggregated. The changes ensure that the system now accurately records and processes these streak achievements, providing a more reliable view of player performance. Additionally, a minor version string update was included for consistency.

Highlights

  • Analytics Fix: Corrected the tracking of 'streak_10_count' in analytics and stats services, resolving an issue where streak-10 achievements were silently dropped.
  • Version Alignment: Updated the internal _VERSION constant in server/views.py to align with the manifest.json.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • custom_components/beatify/analytics.py
    • Updated the GameRecord TypedDict to reflect streak_10_count instead of streak_7_count.
    • Modified compute_streak_stats to correctly sum and return streak_10_total.
  • custom_components/beatify/server/views.py
    • Updated the _VERSION constant from '2.6.0-dev' to '2.6.0'.
  • custom_components/beatify/services/stats.py
    • Changed the key used to retrieve streak counts from game_summary to streak_10_count.
Activity
  • The pull request fixes a root cause where analytics.py and stats.py were reading a non-existent streak_7_count key, leading to silent data loss for streak-10 achievements.
  • Existing unit tests are noted to cover streak scoring, and the fix ensures correct analytics aggregation for 10-consecutive correct answers.
  • This pull request closes issue Bug: Streak-10 milestone untracked in analytics (streak_7 tracked instead) #188.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@mholzi mholzi merged commit f7b0e92 into main Feb 20, 2026
5 checks passed
@mholzi mholzi deleted the fix/188-streak10-analytics branch February 20, 2026 10:02
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

The pull request effectively addresses the identified issue where streak_10_count was not being correctly tracked and aggregated in analytics. The changes correctly update the GameRecord TypedDict, compute_streak_stats function in analytics.py, and the record_game function in services/stats.py to use streak_10_count instead of the deprecated streak_7_count. Additionally, the _VERSION in server/views.py has been aligned with manifest.json. The changes are clear and directly resolve the problem.

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.

Bug: Streak-10 milestone untracked in analytics (streak_7 tracked instead)

1 participant