fix: [MR-145] updated assessment-survey package to 1.2.0 to include english assessment#1993
fix: [MR-145] updated assessment-survey package to 1.2.0 to include english assessment#1993janfb-codev wants to merge 1 commit into
Conversation
…sessment passed appVersion to FeatureFlagService.init
📝 WalkthroughWalkthroughApp.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. ChangesFeature Flags App Version
Estimated code review effort: 1 (Trivial) | ~3 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/feedTheMonster.ts (1)
94-96: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueReuse cached
versionInfoElementinstead of re-querying the DOM.
this.versionInfoElementis already assigned in the constructor (Lines 67-69) from the same element. Prefer reusing it instead of a seconddocument.getElementByIdlookup.♻️ 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
⛔ Files ignored due to path filters (2)
package-lock.jsonis excluded by!**/package-lock.json,!**/*.json,!package-lock.jsonpackage.jsonis excluded by!**/*.json
📒 Files selected for processing (1)
src/feedTheMonster.ts
Changes
@curiouslearning/assessment-surveyto^1.2.0, which adds the English assessment content.version-info-idelement,vprefix stripped) asappVersionon the Statsig user infeatureFlagsService.init. This lets theassessmentlevelsdynamic 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
/initializerequest payload includes"appVersion":"1.5.1"(no leadingv).assessmentlevelsconfig 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
v.