RocketChat / RocketChat/Rocket.Chat

Auto Translation - /api/v1/autotranslate.translateMessage never returns exception on Translation failed

Open
#20,802 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

Description:

The Rest API endpoint /api/v1/autotranslate.translateMessage will always return { success: true } even if the request to the translation providers is failed. This makes debugging impossible because we cannot know what is happening.

Steps to reproduce:
  1. Enable Auto Translation with an API that exceeded the quota
  2. Send an API request to /api/v1/autotranslate.translateMessage
Expected behavior:

A detailed error response returned

Actual behavior:

Success response returned

Server Setup Information:
  • Version of Rocket.Chat Server:
  • Operating System: Linux
  • Deployment Method: docker
  • Number of Running Instances: 1
  • DB Replicaset Oplog: enabled
  • NodeJS Version: 12.18.4
  • MongoDB Version: 4
Client Setup Information
  • Desktop App or Browser Version: Browser
  • Operating System: Windows
Additional context
Relevant logs:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at rocket.chat/app/autotranslate/server/deeplTranslate.js:188 and trace the /api/v1/autotranslate.translateMessage request through the translation provider failure path. Reproduce the case with a provider quota exceeded, then verify that the endpoint returns the provider's detailed error instead of success: true.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.