Skip to content

fix(group-translate): parse res.body instead of res.json()#11

Merged
rmyndharis merged 1 commit into
mainfrom
fix/group-translate-net-json
Jun 25, 2026
Merged

fix(group-translate): parse res.body instead of res.json()#11
rmyndharis merged 1 commit into
mainfrom
fix/group-translate-net-json

Conversation

@rmyndharis

Copy link
Copy Markdown
Owner

The sandboxed ctx.net.fetch returns the response body as a string with no .json() method (functions can't cross the worker structuredClone boundary), so res.json() threw on every call and the LibreTranslate client failed open — translations never applied (a silent no-op). The client now parses res.body directly.

Tests are updated to the real runtime shape (body string, json() unavailable), which reproduces the bug then verifies the fix. v1.0.3v1.0.4. Full repo gate green (tsc, 139 tests, catalog).

Closes #10

…ons were a silent no-op)

The sandboxed ctx.net.fetch returns the response body as a string with no
.json() method (functions can't cross the worker structuredClone boundary),
so res.json() threw on every call and the client failed open — translations
never applied. Parse res.body directly. Tests now use the real runtime shape.

Closes #10
@rmyndharis rmyndharis merged commit 5d8f9ab into main Jun 25, 2026
1 check passed
@rmyndharis rmyndharis deleted the fix/group-translate-net-json branch June 25, 2026 16:01
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.

group-translate: ctx.net.fetch has no .json() at runtime → translation silently fails

1 participant