fix: lionbridge connector correctness/compliance fixes + test parity - #656
Open
markdaugherty wants to merge 11 commits into
Open
fix: lionbridge connector correctness/compliance fixes + test parity#656markdaugherty wants to merge 11 commits into
markdaugherty wants to merge 11 commits into
Conversation
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).
3 tasks
- 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
marked this pull request as ready for review
August 11, 2026 17:58
usman-khalid
requested review from
hannessolo,
mhaack,
sharanyavinod and
usman-khalid
August 11, 2026 18:01
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.
This was referenced Aug 11, 2026
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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):
providerIdmust be sent onsubmit, notcreateJob— the API silently drops it onPOST /jobs, then rejectssubmitwith"Job is missing providerId".retrievefileneedsAccept: application/octet-stream, not the defaultapplication/json(403s otherwise).auth.jsnow resolves the da-etc origin via the sharedDA_ETCexport (env-override support via?da-etc=) instead of a hardcoded URL.Compliance with Lionbridge's dev guidelines:
Retry-After.jobName/requestNametruncated to the 250-byte limit..da/translate.json, written once), prefixed ontoconnectorNameper their connector-fingerprinting requirement.approveendpoint after a successful download/save, closing out the request in Lionbridge's review workflow (REVIEW_TRANSLATION→TRANSLATION_APPROVED).cancelTranslationexport — their guidelines explicitly prohibit connectors from letting users cancel in-progress jobs; documented inline.Test parity:
auth.test.js,connectorGuid.test.js, and fullindex.test.jscoverage forsendAllLanguages/getStatusAll/saveItems/connect, matching Trados/Smartling's depth.providerIdandAccept-header bugs above.Shared connector cleanup
Audited all translation connectors for duplicate code and extracted shared functions into
nx/blocks/loc/utils/:downloadQueue.js: theQueue+ throttle-poll-until-every-url-has-a-status pattern insaveItemswas copy-pasted identically across all 4 real connectors. Each now calls a single shareddownloadQueue(urls, callback, concurrency = 5).auth.js(formerly Lionbridge's own file): Trados's and Lionbridge's per-connectorauth.jswere near-verbatim duplicates of the same da-etc login/token-cache flow.Test coverage consolidated alongside: the old
lionbridge/auth.test.jscases moved into a generictest/loc/utils/auth.test.js, which also provides Trados new auth test coverage.Verification
sendAllLanguageschain (createJob → upload → addRequest → submit),getStatusAll,saveItems/retrievefile, andapprove.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.liveconnector documentation. The following pages have draft updates pending publish:getItems()instead of thesaveItems()every real connector implementsauthEndpoint/apiEndpointvaluesDependency
This connector can't authenticate against a real Lionbridge account until da-sites/da-etc#2 merges.