Repository navigation
Conversation
…te each caption once - E-04: TranslateService keeps a map of requests in flight by cache key. An identical call made before the first one answers waits for it and gets the same answer, so only one request goes out. The entry is removed when the request settles; a failure reaches every waiting caller and is never cached. - E-06: new src/subtitle/helpers/caption-translation-gate.ts. With "translate whole caption" on, the Netflix and support-template caption components wait about 150 ms for the caption to settle, then send it only when the joined text differs from the caption already translated on screen. A failed caption can be sent again. Turning the option on still translates at once. - Tests: in-flight cases in tests/translate.service.test.ts, new tests/caption-translation-gate.test.ts. Work list: subturtle-doc docs/tech/analytics-fixes-implementation.md Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
Replaced by #62, which combines all extension rows (E-01 to E-06) into one PR. |
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.
What
TranslateServicekeeps a map of requests on their way, by cache key. If the same call comes in before the first one answers, it waits for that request and gets the same answer. Only one network call goes out. The entry is removed when the request settles. A failure reaches every waiting caller and is never cached.src/subtitle/helpers/caption-translation-gate.ts, used byweb_netflix/components/Subtitle.vueand_support-template/components/Subtitle.vue. With "translate whole caption" on:Why
The cache was filled only after the answer came back, so two calls for the same text at the same time both went out. The caption watcher sent a request on every caption change, sometimes more than once for one caption. Work list: subturtle-doc
docs/tech/analytics-fixes-implementation.md(rows E-04, E-06).How tested
tests/translate.service.test.ts(one request for two calls, detailed too, different keys not shared, failure reaches both callers and is not kept) andtests/caption-translation-gate.test.ts(settle delay, skip same caption, A → B → A, send now, retry after failure, cancel).yarn typecheck: clean.yarn test: 41 files, 369 tests pass.yarn build: OK.Dependencies
translate.service.tschange is kept small and away from the lines fix(analytics): E-01 E-05 send the install id and trigger with translation calls #58 (E-01/E-05) changes. I checked withgit merge-tree: this PR merges cleanly with fix(analytics): E-01 E-05 send the install id and trigger with translation calls #58, feat(analytics): E-02 track installs and updates and open the welcome page #59 and feat(analytics): E-03 track the save-login prompt and login results #60 in any order.🤖 Generated with Claude Code