Skip to content

fix: [MR-145] updated assessment-survey package to 1.2.0 to include english assessment#1993

Open
janfb-codev wants to merge 1 commit into
testfrom
feature/MR-145
Open

fix: [MR-145] updated assessment-survey package to 1.2.0 to include english assessment#1993
janfb-codev wants to merge 1 commit into
testfrom
feature/MR-145

Conversation

@janfb-codev

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

Copy link
Copy Markdown
Contributor

Changes

  • Upgrade @curiouslearning/assessment-survey to ^1.2.0, which adds the English assessment content.
  • Pass the FTM app version (from the version-info-id element, v prefix stripped) as appVersion on the Statsig user in featureFlagsService.init. This lets the assessmentlevels dynamic config target clients with an App Version ≥ X condition, so stale builds that lack a language's assessment content aren't shown an assessment.

How to test

  • Runtime: open FTM, and in DevTools confirm the Statsig /initialize request payload includes "appVersion":"1.5.1" (no leading v).
  • In Statsig, add an App Version ≥ condition to the assessmentlevels config and verify the assessment shows only for builds at/above the threshold; older builds are gated out instead of falling back to the Zulu assessment.

Ref: MR-145

Summary by CodeRabbit

  • Bug Fixes
    • Improved app version detection so version information is cleaned up before being sent to feature flagging, including removing extra spaces and a leading v.
    • This helps ensure users receive the correct feature experience based on the app version.

…sessment

passed appVersion to FeatureFlagService.init
@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

App.init() now computes an appVersion string by reading and trimming the version-info-id DOM element's innerHTML and stripping a leading v/V prefix, then includes this value in the user object passed to featureFlagsService.init.

Changes

Feature Flags App Version

Layer / File(s) Summary
Compute and pass appVersion
src/feedTheMonster.ts
App.init() derives appVersion from the version-info-id element, trims whitespace, strips a leading v/V, and passes it in the user object to featureFlagsService.init.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Possibly related PRs

Suggested reviewers: ashwinnair-chimple, bernhardccodev

🚥 Pre-merge checks | ✅ 5 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Tests & Lint & Coverage ⚠️ Warning The commit only changes package.json/lock and src/feedTheMonster.ts; no tests were added/updated for the new appVersion init path, and no lint/coverage results are present. Add a spec covering feedTheMonster’s Statsig init/appVersion parsing, then run/publish lint and coverage output so coverage ≥70% can be verified.
✅ 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 clearly reflects the main change by updating the assessment-survey package to add English assessment support.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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-145

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
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/feedTheMonster.ts (1)

94-96: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Reuse cached versionInfoElement instead of re-querying the DOM.

this.versionInfoElement is already assigned in the constructor (Lines 67-69) from the same element. Prefer reusing it instead of a second document.getElementById lookup.

♻️ Proposed refactor
-    const appVersion = (document.getElementById("version-info-id")?.innerHTML || '')
+    const appVersion = (this.versionInfoElement?.innerHTML || '')
       .trim()
       .replace(/^v/i, '');
🤖 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 `@src/feedTheMonster.ts` around lines 94 - 96, Reuse the already cached version
element in feedTheMonster instead of calling document.getElementById again;
update the appVersion logic to read from this.versionInfoElement that is
initialized in the constructor, and keep the same trimming/version-stripping
behavior while avoiding the redundant DOM lookup.
🤖 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 `@src/feedTheMonster.ts`:
- Around line 94-96: Reuse the already cached version element in feedTheMonster
instead of calling document.getElementById again; update the appVersion logic to
read from this.versionInfoElement that is initialized in the constructor, and
keep the same trimming/version-stripping behavior while avoiding the redundant
DOM lookup.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a65327c7-e5b9-4ef9-874e-c3328a6f214d

📥 Commits

Reviewing files that changed from the base of the PR and between 0bfb8a9 and be61438.

⛔ Files ignored due to path filters (2)
  • package-lock.json is excluded by !**/package-lock.json, !**/*.json, !package-lock.json
  • package.json is excluded by !**/*.json
📒 Files selected for processing (1)
  • src/feedTheMonster.ts

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