Skip to content

fix: [MR-159] add Curious Reader language to user_sessions_data metadata#277

Open
janfb-codev wants to merge 3 commits into
developfrom
feature/MR-159
Open

fix: [MR-159] add Curious Reader language to user_sessions_data metadata#277
janfb-codev wants to merge 3 commits into
developfrom
feature/MR-159

Conversation

@janfb-codev

@janfb-codev janfb-codev commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Changes

  • Enrich every user_sessions_data event with the Curious Reader selected language, written to metadata.language.
  • Scoped to user_sessions_data only, summary_data payloads are unaffected.

How to test

  • Manual: launch a sub-app (Feed The Monster) from a selected language, complete a level to fire a LEVEL_COMPLETED event, and confirm the new user_sessions_data document in Firestore includes metadata.language matching the selected language.

Ref: MR-159

Summary by CodeRabbit

  • New Features
    • User session data now includes the app’s language when available.
    • If the language cannot be determined, session data records it as “unknown.”

@janfb-codev
janfb-codev requested a review from miguelccodev July 22, 2026 06:10
@janfb-codev janfb-codev self-assigned this Jul 22, 2026
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

user_sessions_data payloads now include a resolved language metadata field, using "unknown" when the application context value is unavailable or invalid.

Changes

Session payload language enrichment

Layer / File(s) Summary
Resolve and store session language
app/src/main/java/org/curiouslearning/container/core/subapp/handler/DefaultAppEventPayloadHandler.java
storeUserSessionPayload initializes metadata and records the language resolved from AppContext; missing, blank, or failed lookups use "unknown" and log a warning on failure.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: miguelccodev, rajesh1041

🚥 Pre-merge checks | ✅ 5 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Tests & Lint & Coverage ⚠️ Warning HEAD changes only AppContext/.gitignore; no app/src/test or androidTest files were modified, so the PR lacks test updates. Add/update tests for the new behavior, then run the project lint task and Jacoco report to confirm lint passes and coverage is >=70%.
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately describes the main change by adding Curious Reader language to user_sessions_data metadata.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/MR-159

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
app/src/main/java/org/curiouslearning/container/core/subapp/handler/DefaultAppEventPayloadHandler.java (1)

199-206: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add regression coverage for enrichment scope and fallback behavior.

Please cover: selected language on user_sessions_data, "unknown" for missing/blank/invalid values, and absence of this field from summary_data.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@app/src/main/java/org/curiouslearning/container/core/subapp/handler/DefaultAppEventPayloadHandler.java`
around lines 199 - 206, Add regression tests for the enrichment logic around
resolveLanguage and payload metadata: verify the selected language is written to
user_sessions_data, missing, blank, and invalid language values resolve to
"unknown", and summary_data does not receive a language field. Keep existing
enrichment behavior unchanged and exercise both valid and fallback cases.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In
`@app/src/main/java/org/curiouslearning/container/core/subapp/handler/DefaultAppEventPayloadHandler.java`:
- Around line 199-206: Add regression tests for the enrichment logic around
resolveLanguage and payload metadata: verify the selected language is written to
user_sessions_data, missing, blank, and invalid language values resolve to
"unknown", and summary_data does not receive a language field. Keep existing
enrichment behavior unchanged and exercise both valid and fallback cases.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: db776425-0581-4dce-b9c2-a7cd07d4eadb

📥 Commits

Reviewing files that changed from the base of the PR and between 2ece295 and dfe19d8.

📒 Files selected for processing (1)
  • app/src/main/java/org/curiouslearning/container/core/subapp/handler/DefaultAppEventPayloadHandler.java

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.

1 participant