-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
enhancementNew feature or requestNew feature or requestrefactorchanging the internal structure of code without changing its external behaviorchanging the internal structure of code without changing its external behaviortech-debtcode that was once acceptable but has become a liability — too tightly coupled, hard to test, etccode that was once acceptable but has become a liability — too tightly coupled, hard to test, etc
Description
Problem
fetchProblemsForSession() currently has 5+ distinct responsibilities and is difficult to test or extend:
- Pulls settings
- Computes adaptive values
- Fetches review problems
- Fetches new problems
- Deduplicates + pads session
- Logs and returns session
This makes reasoning about the logic harder and prevents reusability in other flows (e.g. onboarding, review-only mode).
Proposed Refactor
Break into 3 distinct layers:
-
createSession() → High-level coordinator
-
buildAdaptiveSessionSettings() → Handles adaptive sizing & difficulty logic
-
fetchAndAssembleSessionProblems() → Handles fetching review + new problems, deduping, padding
Labels
refactorenhancementtech-debtpriority: medium
Outcome
- Cleaner, testable separation of concerns
- Prepares for session dashboards, mastery trends
- Lays groundwork for contributors or A/B testing in session logic
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestrefactorchanging the internal structure of code without changing its external behaviorchanging the internal structure of code without changing its external behaviortech-debtcode that was once acceptable but has become a liability — too tightly coupled, hard to test, etccode that was once acceptable but has become a liability — too tightly coupled, hard to test, etc