Skip to content

fix: lionbridge connector correctness/compliance fixes + test parity - #656

Open
markdaugherty wants to merge 11 commits into
adobe:mainfrom
markdaugherty:lionbridge-connector
Open

fix: lionbridge connector correctness/compliance fixes + test parity#656
markdaugherty wants to merge 11 commits into
adobe:mainfrom
markdaugherty:lionbridge-connector

Conversation

@markdaugherty

@markdaugherty markdaugherty commented Aug 11, 2026

Copy link
Copy Markdown
Member

Summary

Continues the Lionbridge translation connector work from #651 (thanks @ravuthu). Fixes found by testing against the real Lionbridge Content API v2 and the real DA Translate app UI, plus compliance work against Lionbridge's dev guidelines, plus test parity with the other connectors (Trados/Smartling).

Supersedes #651

Bug fixes (found via live API testing, not caught by mocked tests):

  • providerId must be sent on submit, not createJob — the API silently drops it on POST /jobs, then rejects submit with "Job is missing providerId".
  • retrievefile needs Accept: application/octet-stream, not the default application/json (403s otherwise).
  • auth.js now resolves the da-etc origin via the shared DA_ETC export (env-override support via ?da-etc=) instead of a hardcoded URL.

Compliance with Lionbridge's dev guidelines:

  • Rate-limit handling: retry 429/503 with exponential backoff, honoring Retry-After.
  • jobName/requestName truncated to the 250-byte limit.
  • Generate and persist a per org/site/env connector GUID (in .da/translate.json, written once), prefixed onto connectorName per their connector-fingerprinting requirement.
  • Call the approve endpoint after a successful download/save, closing out the request in Lionbridge's review workflow (REVIEW_TRANSLATIONTRANSLATION_APPROVED).
  • No cancelTranslation export — their guidelines explicitly prohibit connectors from letting users cancel in-progress jobs; documented inline.

Test parity:

  • Added auth.test.js, connectorGuid.test.js, and full index.test.js coverage for sendAllLanguages/getStatusAll/saveItems/connect, matching Trados/Smartling's depth.
  • Two tests directly regression-lock the providerId and Accept-header bugs above.

Shared connector cleanup

Audited all translation connectors for duplicate code and extracted shared functions into nx/blocks/loc/utils/:

  • downloadQueue.js: the Queue + throttle-poll-until-every-url-has-a-status pattern in saveItems was copy-pasted identically across all 4 real connectors. Each now calls a single shared downloadQueue(urls, callback, concurrency = 5).
  • auth.js (formerly Lionbridge's own file): Trados's and Lionbridge's per-connector auth.js were near-verbatim duplicates of the same da-etc login/token-cache flow.

Test coverage consolidated alongside: the old lionbridge/auth.test.js cases moved into a generic test/loc/utils/auth.test.js, which also provides Trados new auth test coverage.

Verification

  • Standalone scripts against real Lionbridge staging APIs: full sendAllLanguages chain (createJob → upload → addRequest → submit), getStatusAll, saveItems/retrievefile, and approve.
  • Full end-to-end through the real DA Translate app UI (da.live/apps/loc) against a real test site (scdemos/lionbridge-demo — new GitHub repo + AEM Code Sync + DA content), with the backend (da-sites/da-etc#2) running locally via ?da-etc=local: created a project, sent a real page for translation, polled status to completion, and confirmed the translated copy landed at /fr/test-page.html.
  • npm test (1342 tests) and lint pass.

Documentation

Lionbridge was missing from the public docs.da.live connector documentation. The following pages have draft updates pending publish:

Dependency

This connector can't authenticate against a real Lionbridge account until da-sites/da-etc#2 merges.

ravuthu and others added 2 commits August 10, 2026 11:22
Builds on the initial connector implementation (adobe#651) with fixes found
via live testing against Lionbridge's Content API v2:

- providerId must be sent on job submit, not job creation (the API
  silently drops it on POST /jobs; submit fails without it)
- retrievefile needs Accept: application/octet-stream, not the default
  application/json (403s otherwise); other endpoints are unaffected
- add rate-limit handling (429/503 retry with exponential backoff,
  honoring Retry-After) per Lionbridge's dev guidelines
- truncate jobName/requestName to the 250-byte guideline limit
- generate and persist a per org/site/env connector GUID, prefixed onto
  connectorName per Lionbridge's connector-fingerprinting guideline
- call the approve endpoint after a successful download/save, closing
  out the request in Lionbridge's review workflow
- fix auth.js to resolve the da-etc origin via the shared DA_ETC export
  (with env-override support) instead of a hardcoded URL
- add test coverage for auth.js, connectorGuid.js, and the full
  sendAllLanguages/getStatusAll/saveItems flow (previously only
  statusFor had tests)

Verified end-to-end against real Lionbridge staging APIs and, separately,
through the actual DA Translate app UI against a real test site
(scdemos/lionbridge-demo).
- Add JSDoc to every function in index.js, auth.js, and connectorGuid.js
  that was missing it.
- CONNECTOR_NAME is now "DA Live Localization for Lionbridge" instead of
  the generic "DA Live Localization", to distinguish it from connectors
  for other vendors in Lionbridge's own job/connector listings.
@markdaugherty
markdaugherty marked this pull request as ready for review August 11, 2026 17:58
Mark Daugherty added 2 commits August 11, 2026 15:16
…copy

Extracted while fixing the same class of issue in the Smartling
connector (429s during batch jobs) — rather than maintain two nearly
identical retry/backoff implementations, both now share
nx/blocks/loc/utils/fetchWithRetry.js. Passes an explicit RETRY_CONFIG
(maxRetries: 3, maxDelayMs: 8000, 429/503 only) to preserve this
connector's existing tuning exactly; behavior is unchanged.
Mark Daugherty and others added 5 commits August 24, 2026 11:32
Audited all 5 loc connectors for duplicate code before extracting
anything; two candidates were genuinely duplicated and safe to merge.

- nx/blocks/loc/utils/downloadQueue.js: the Queue + setInterval
  poll-until-every-url-has-status pattern was identical across all 4
  real connectors' saveItems. Each now ends with one call instead of
  ~15 duplicated lines.

- nx/blocks/loc/utils/auth.js: Trados's and Lionbridge's auth.js were
  near-verbatim duplicates of the same da-etc login/token-cache flow.
  Consolidated into a single module exporting getAccessToken/authReady
  keyed by connector name; deleted both per-connector auth.js files
  entirely since they'd shrunk to trivial delegations. Along the way,
  merged LOGIN_ORIGIN onto the DA_ETC-aware definition (giving Trados a
  local-dev override it didn't have) and confirmed against da-etc's own
  routes/ints.js that including ?env= is correct for both connectors,
  not just Lionbridge (Trados previously never sent it).

Left alone: Smartling/GLaaS's auth (fundamentally different flows),
Trados/GLaaS's CORS-proxy-wrapper duplication, and GLaaS's partial
overlap with the shared dnt.js helpers - flagged, not extracted here.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.

3 participants