Page MenuHomePhabricator

Bug 1840705 - Fix isRunning typo in translations-engine-worker.js r=marco
ClosedPublic

Authored by saschanaz on Oct 12 2023, 5:16 PM.
Referenced Files
Unknown Object (File)
Mon, Jun 15, 10:12 PM
Unknown Object (File)
Tue, May 26, 7:03 AM
Unknown Object (File)
Tue, May 26, 7:03 AM
Unknown Object (File)
May 13 2026, 9:28 AM
Unknown Object (File)
May 12 2026, 6:36 AM
Unknown Object (File)
May 12 2026, 3:59 AM
Unknown Object (File)
May 11 2026, 5:22 PM
Unknown Object (File)
May 7 2026, 10:05 AM
Subscribers
None

Event Timeline

phab-bot changed the visibility from "Custom Policy" to "Public (No Login Required)".
phab-bot changed the edit policy from "Custom Policy" to "Restricted Project (Project)".
phab-bot removed a project: secure-revision.

I can confirm this works, but do we have a test for this?

(Maybe this is why we should use TypeScript)

......... well crap.

(Maybe this is why we should use TypeScript)

I have missed it every day I have worked on this project.

testing-exception-other: This is a timing based issue, so it's not really testable without mocking out the timing functions. That doesn't seem reasonable here.

This revision is now accepted and ready to land.Oct 12 2023, 8:10 PM

I don't have a Twitter account anymore to verify the original report, but this doesn't seem to fix the infinite scrolling on reddit.com.

STR:

  1. Go to reddit.com
  2. Manually translate from English to Spanish.
  3. Wait until the page is fully translated.
  4. Scroll down to the bottom to load in new reddit posts.

Expected:
These new posts should be translated.

Actual:
The posts are still in English.

I don't have a Twitter account anymore to verify the original report, but this doesn't seem to fix the infinite scrolling on reddit.com.

STR:

  1. Go to reddit.com
  2. Manually translate from English to Spanish.
  3. Wait until the page is fully translated.
  4. Scroll down to the bottom to load in new reddit posts.

Expected:
These new posts should be translated.

Actual:
The posts are still in English.

That works for me.

  1. Go to reddit.com and sign in
  2. Turn on multiprocess browser toolbox in multiprocess mode, pick translations-engine-worker.js, open chrome://content/translations/translations-engine-worker.js
  3. Add logger breakpoints to line 732 (the start of the while loop) and line 771 (the end of the function) to track the progress, and optionally also at line 714 to track the requests-while-running.
  4. Manually translate from English to German
  5. Wait until the page is fully translated, i.e. wait for the line 771 log message you added at step 3
  6. Scroll down to the bottom and see you get the line 732 log message you added at step 3 and then eventually the line 771 one again.

I'm landing this as this fix should be valid even if it doesn't fix the Reddit case (although I believe it does).

This is a timing based issue, so it's not really testable without mocking out the timing functions. That doesn't seem reasonable here.

While yes, although maybe there could be a postMessage from worker that tells the queue is now empty?