Closed Bug 1588539 Opened 5 years ago Closed 3 years ago

document auto refresh in background tab's timers sometimes succeeds, but should be paused

Categories

(GeckoView :: General, defect, P3)

68 Branch
Unspecified
Android

Tracking

(firefox-esr68 wontfix)

RESOLVED WORKSFORME
Tracking Status
firefox-esr68 --- wontfix

People

(Reporter: lmironov, Unassigned)

References

(Blocks 1 open bug)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0 SeaMonkey/2.53.1 Lightning/5.8

Steps to reproduce:

  • Go to http://livescores.worldsnookerdata.com/ and click on "live scores", but only when a match is on.
  • Press android home button to move firefox into background
  • Wait for 60+ seconds
  • Return to firefox

Actual results:

"Server not found" firefox page is displayed

Expected results:

live scores should've been displayed. 68.1.1 The page in question is refreshed by the following code:

 <script type="text/javascript">
        function getUrlParameter(sParam) {
            var sPageUrl = window.location.search.substring(1);
            var sUrlVariables = sPageUrl.split('&');
            for (var i = 0; i < sUrlVariables.length; i++) {
                var sParameterName = sUrlVariables[i].split('=');
                if (sParameterName[0] == sParam) {
                    return sParameterName[1];
                }
            }
            return null;
        }
        var targetRefresh = 60;
        function refreshTimerDisplay() {
            targetRefresh -= 1;
            if (targetRefresh <= 0) {
                var url = $(location).attr('pathname') + '?pos=' + $(document).scrollTop();
                window.location.replace(url);
                targetRefresh = 60;
            }
            $('#label-timer').html(targetRefresh);
        }
        if (getUrlParameter('pos') !== null) {
            var scrollPos = parseInt(getUrlParameter('pos'));
            window.scrollTo(0, scrollPos);
        }
        var tmrReloadPage = setInterval(refreshTimerDisplay, 1000);
    </script>

Asking QA to also give this a test on Fenix Nightly.

Flags: needinfo?(diana.rus)
Priority: -- → P1

correction to the step 1: ...go to http://livescores.worldsnookerdata.com/ and click on "MAIN MENU->live scores"...

Hi, I checked with the steps from description with Samsung Galaxy Tab A (Android 9) and Sony Xperia Z5 (Android 7.0) on Firefox Preview Nightly/Fenix Nightly 191016 (Build #12890612).
I did reproduce the issue but only with Sony Xperia Z5 (Android 7.0) after the second attempt but it does not seem to be something that is reproducible all the time.

Note:
Did not encounter the issue with Samsung Galaxy Tab A (Android 9) and Sony Xperia Z5 (Android 7.0) on Firefox Release 68.2.0 and Firefox Beta 68.2b7.

Flags: needinfo?(diana.rus)

In my case it is 100% reproducible on caterpillar S61 with android 9, even with battery manager disabled and background execution allowed for firefox.

Asking the GV team to triage this. If this requires changes in the embedding application, please need info me and I will move this ticket to the Firefox Preview (Fenix) project. I doubt we will address this for Fennec, unless it is something that we would do in platform.

Product: Firefox for Android → GeckoView
Version: Firefox 68 → 68 Branch
OS: Unspecified → Android
Priority: P1 → --

This behavior is by design. We want to throttle or pause timers in background tabs to avoid background tabs from using up all your battery. That background tab timers work intermittently on some devices is the bug we should fix.

Rank: 50
Priority: -- → P2
See Also: → 1525466
Summary: document auto refresh in background fails → document auto refresh in background tab's timers sometimes succeeds, but should be paused

Need to check that this is still an issue.

Flags: needinfo?(etoop)
Flags: needinfo?(agi)
Flags: needinfo?(etoop)
Priority: P2 → P3

This is not a problem anymore, the page freezes as expected, and the count down resumes when the page is brought back to the foreground.

Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Flags: needinfo?(agi)
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.