Skip to content

fix(server): Starter cannot swap, Portuguese coming later, Tell me in language state (B-05, B-06, B-33) - #138

Merged
navidshad merged 1 commit into
devfrom
ml/e2e-server-fixes
Oct 16, 2026
Merged

navidshad merged 1 commit into
devfrom
ml/e2e-server-fixes

Conversation

@navidshad

Copy link
Copy Markdown
Contributor

Fixes four server problems found by the end-to-end run of multilingual round 1.

What changed

  1. Starter cannot swap (B-33, Council 008). On Starter, add-language now counts languages removed in the last 30 days that are not purged yet. So after removing German, adding Spanish returns upgrade_needed, and adding German back restores it with its data. The race-safe conditional update stays; after it, the server counts once more and undoes the claim if a parallel remove-language opened a gap. Paid plans keep today's behaviour.
  2. Portuguese "Coming later" (B-06). pt ("Portuguese", "Português") is in the register with enabled: false and every feature false, so clients can show it under "Coming later" with Tell me. LANGUAGES_ENABLED never switches it on. add-language refuses it with not_available.
  3. Tell me forgets (B-06). get-language-state now returns interests: LangCode[], the languages the learner asked to be told about.
  4. pause-languages (B-33). No code change; a new test pins what it does: keep first in order, then the active language, then other active and paused ones oldest first, up to the limit; the rest paused; removed ones untouched.

The contract (docs/tech/multilingual-api.md, docs repo) is updated to match.

Tested: yarn test in server/ (75 suites, 1848 tests pass, in-memory MongoDB), tsc --noEmit clean.

🤖 Generated with Claude Code

… language state (B-05, B-06, B-33)

- add-language on Starter: a language removed in the last 30 days and not
  purged still holds its slot, so adding a different one returns
  upgrade_needed; adding the removed one back restores it. Re-checked after
  the conditional update, so a parallel remove cannot open a swap.
- Register lists Portuguese (pt) with enabled false and no features;
  LANGUAGES_ENABLED never switches it on; add-language refuses it.
- get-language-state returns interests (the learner's Tell me languages).
- Test for what pause-languages does with keep, spare room and removed ones.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@navidshad
navidshad merged commit e7d2d0a into dev Oct 16, 2026
6 checks passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.3.0-dev.29 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

github-actions Bot pushed a commit that referenced this pull request Oct 16, 2026
# [1.3.0-dev.32](v1.3.0-dev.31...v1.3.0-dev.32) (2026-10-16)

### Bug Fixes

* **frontend:** Starter learners who removed their language can restore it from first run (D-07, D-20, D-25) ([720d7de](720d7de)), closes [#138](#138)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant