Fix handling of orphaned UserWords (no bookmarks)#480
Open
mircealungu wants to merge 2 commits intomasterfrom
Open
Fix handling of orphaned UserWords (no bookmarks)#480mircealungu wants to merge 2 commits intomasterfrom
mircealungu wants to merge 2 commits intomasterfrom
Conversation
Problem: - UserWords could become orphaned (no bookmarks) when bookmarks were deleted, causing 'NoneType' has no attribute 'text' errors in Sentry - article.py clear_bookmarks() didn't mark UserWords as unfit for study - Orphaned words with fit_for_study=1 appeared in exercises but crashed Solution: - as_dictionary() now handles orphaned UserWords gracefully: - Auto-repairs when bookmarks exist but preferred_bookmark is None - Returns minimal data for truly orphaned words (word, translation, rank) - Adds is_orphaned flag so frontend knows context is unavailable - article.py clear_bookmarks() now marks UserWords as unfit when orphaned - exercises.py simplified error handling (orphans handled gracefully) Design: - Orphaned words are kept for historical data (learned words list) - They appear in history with word+translation but no context - They're excluded from exercises via fit_for_study=false - When user translates word again, new bookmark is created Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Shows minutes per month for: - Exercises (red) - Reading (blue) - Browsing (green) - Audio lessons (purple) With caching like monthly active users. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.

Summary
'NoneType' has no attribute 'text'errors in Sentry caused by orphaned UserWordsas_dictionary()now handles orphaned UserWords gracefully, returning minimal data (word, translation, rank)article.pyclear_bookmarks()now properly marks UserWords as unfit when bookmarks are clearedChanges
is_orphanedflagTest plan
🤖 Generated with Claude Code