Skip to content

fix(languages): send the user's id with the language calls so the pill and save row work (E-03, E-05) - #56

Merged
navidshad merged 1 commit into
devfrom
fix/language-calls-user-id
Oct 16, 2026
Merged

navidshad merged 1 commit into
devfrom
fix/language-calls-user-id

Conversation

@navidshad

Copy link
Copy Markdown
Collaborator

What

The multilingual popup pill, the language list and the save window language row never showed against a real server.

The server's user_access functions read the account from args.userId (modular-rest does not add it; the server's caller guard only checks that it is yours). get-language-state, set-active-language and keep-phrase-pending sent no userId, so the server answered 400 User ID is required. The client then treats the language module as missing and falls back to the English-only popup, without any error. The unit tests mock the server, so they did not catch it.

Now each of those calls sends the signed-in user's id (get-language-capabilities stays anonymous).

Rows: E-03, E-05 (and E-06 / E-07, which use the same calls).

How it was tested

  • New tests/language-api.test.ts checks the args of every language call; the whole Vitest suite passes (352), typecheck clean, yarn build and the Playwright e2e suite pass (22).
  • Live: the built extension, pointed at a local server (local MongoDB, no AI keys; only translateWithContext stubbed), in a Chromium profile with a local test account:
    • before: popup shows no pill; get-language-state → 400 User ID is required;
    • after: the pill shows "English · Saves go here · Starting at B1", the list shows "German · Deutsch", picking German switches it on the server, the save window shows "German · detected · Saves to your German profile" and "Save to German", and an Italian sentence shows "Italian is not in your languages yet" with Keep for Italian, which the server keeps for 30 days.

🤖 Generated with Claude Code

…l and save row work (E-03, E-05)

The server's user_access functions read the account from args.userId and answer
"User ID is required" without it. get-language-state, set-active-language and
keep-phrase-pending sent no userId, so against a real server the popup pill, the
language list and the save window language row never showed.

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

Copy link
Copy Markdown

🎉 This PR is included in version 1.17.0-dev.6 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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