Draft
Conversation
Previously, the daily streak was updated on ANY authenticated API call (via the @requires_session decorator), causing streaks to continue even when users just opened the app without practicing. Changes: - Add reset_streak_if_broken() to UserLanguage - resets streak to 0 if user hasn't practiced in 2+ days (called on login) - Change @requires_session to call reset_streak_if_broken() instead of update_streak_if_needed() - only resets broken streaks, doesn't increment - Add update_user_streak() helper function for practice endpoints - Add streak updates to actual practice endpoints: - /report_exercise_outcome (completing exercises) - /reading_session_start (starting to read) - /listening_session_start (starting to listen) - /get_one_translation (translating words while reading) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Saves max_streak and max_streak_date before resetting daily_streak, so users can see their all-time best even after breaking a streak. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Feature/see friend profile
Feature/profile
Merge changes from master to gamification
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Article.find_or_create() was using np_article.html (raw newspaper HTML) instead of np_article.htmlContent (readability server output). This caused navigation menus, headers, and footers to appear as bullet-point lists in shared articles. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The LLM returns JSON with literal newlines inside string values (instead of escaped \n), which json.loads rejects in strict mode. This caused fallback to DeepSeek (~90s vs ~3s for Anthropic). Using json.loads(strict=False) accepts these control characters. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Skip expensive tokenization when caller only needs article metadata (id, language, title). Used by SharedArticleHandler to show the language choice modal immediately without waiting for NLP processing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Downloads and detects language + title without creating the article in the DB. Returns instantly for already-existing articles. Reverts the withContent flag — no longer needed since the share flow now uses this lightweight endpoint instead of find_or_create_article. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Feature/gamification feature flag
6 tasks
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.
Gamification of Zeeguu
In this PR we have added the backend for features such as friends, friend streak, badges, friend leaderboard, classroom leaderboard.
In one image we have added:

Database changes
See changes in
tools/migration26-02-19--add_badges.sql26-02-24-a-add_username.sql26-02-24-b-add_username.py26-02-24--friendship_system.sql26-02-26--add_max_streak_to_user_language.sql26-02-28--insert_default_badges.sql26-02-28--add_user_avatar.sqlWe have added new tables:
Testing added
test_friends.py(core/model)test_friends.py(api)test_badges.pyIssues and dicussions
Also see sub issues
Breakdown PRs of features
Gamification feature flag
Friends and Profile
Badges
Leaderboards