Open Bug 1738876 Opened 4 years ago Updated 9 days ago

tools.usps.com/rcas.htm is intermittently stuck in a loading state

Categories

(Web Compatibility :: Site Reports, defect, P2)

Firefox 96
Desktop
Windows

Tracking

(Webcompat Priority:P2, Webcompat Score:7, firefox96 affected)

Webcompat Priority P2
Webcompat Score 7
Tracking Status
firefox96 --- affected

People

(Reporter: rbucata, Unassigned, NeedInfo)

References

()

Details

(Keywords: webcompat:contact-in-progress, webcompat:site-report, Whiteboard: [webcompat:sightline][webcompat:core])

User Story

platform:windows,mac,linux,android
impact:workflow-broken
configuration:general
affects:some
branch:release
diagnosis-team:dom
user-impact-score:720

Attachments

(2 files)

Attached image Screenshot_13.png

Environment:
Operating system: Windows 10 x64 PRO
Firefox version: :Firefox Nightly 96.0a1 (2021-11-01) (64-bit)

Preconditions:
ETP set to STANDARD
Clean profile

Steps to reproduce:

  1. Navigate to :https://tools.usps.com/rcas.htm
  2. Observe the result

Expected Behavior:
The page loads

Actual Behavior:
The page is stuck in a loading state

Notes:

  • Not reproducible with ETP turned off
  • Works as expected using Chrome
  • Screenshot attached
No longer blocks: tp-breakage

This is also reproducible with CookieBehavior 4(ETP).

Severity: -- → S2

Hmm, the issue is still present if I disable ETP by using the ETP toggle.

Raul, could you verify again?

Flags: needinfo?(raul.bucata)

With a clean fresh profile, disabling the ETP by using the ETP toggle triggers the loading of the page on my side, as expected.

Tested with:

Browser / Version: Firefox Nightly 96.0a1 (2021-11-04) (64-bit)
Operating System: Windows 10 PRO x64

Flags: needinfo?(raul.bucata)

This is not constantly reproducible and I can reproduce it even with ETP disabled(Note that it might work on the first try, but you will see the issue after several refreshes). So, I think it's not an anti-tracking issue but more like a webcompat issue. Given this, I will lower the severity here and ni Tom for webcompat.

Severity: S2 → S3
Flags: needinfo?(twisniewski)
Blocks: tp-breakage
No longer blocks: tp-breakage
Component: Privacy: Anti-Tracking → Desktop
Product: Core → Web Compatibility
Flags: needinfo?(dschubert)

I couldn't really test this because I haven't received an UPS shipment in the last 6 months. However, I found someone on LinkedIn who claims to work on WebDev stuff there, so I sent them a message. I'll update this bug if I hear back from them. :)

User Story: (updated)
Flags: needinfo?(dschubert)
Priority: P3 → P2

It seems like when this is broken we're getting an error Uncaught ReferenceError: unavailableTimer is not defined. unavailableTimer should get defined in a jQuery $(document).ready() call in schedule-jquery.js, which should run on DOMContentLoaded, whereas it should be used in $(window).on('load') in the same script. The script is a normal parser-blocking script, so there's no delayed script loading that causes the race.

However it seems that for some reason the $(document).ready call is happening in a setTimeout set after DOMContentLoaded, which I guess is racing with the load event. So we need to check if that also happens in Chrome and there's some slight timing difference or if they aren't running the setTimeout at all.

User Story: (updated)
Summary: Page is stuck in a loading state at tools.ups.com with ETP set to STANDARD → Page is intermittently stuck in a loading state

Yeah, when DOMContentLoaded is fired, jquery will use setTimeout to schedule the call back for its $(document).ready() (start from here and the callback is scheduled at https://github.com/jquery/jquery/blob/3cad5c435aa2333c39baa55a8bceb2b6bf1e2721/src/deferred.js#L224). So In Gecko, there's a chance that the callback for $(window).on('load') gets to run first, hence unavailableTimer is undefined.

I used Chrome's debugger and confirmed that the callstack is the same. They also execute this window.setTimeout to schedule the callback.

Attached a simple test case to demonstrate the behaviour.

Basically it'll keep reloading itself until the setTimeout callback is fired after the load event handler.

In Firefox, it'll keep reloading a couple of times and stops.

The weird thing is that I always get the same result such that the setTimeout callback is fired after the load event handler in Chrome. So they should hit the same issue as us, but they don't.........so something is working differently.

Summary: Page is intermittently stuck in a loading state → tools.usps.com/rcas.htm is intermittently stuck in a loading state

Looking at this once again, I think my assessment in comment 7 is correct. They site relies on undefined behaviours. There's no guarantee $(document).ready() will always run before window.on('load').

My testcase also demonstrates this can be flaky in Chrome because, my testcase always gets window.on('load') runs first before $(document).ready(), whereas on this site, $(document).ready() always runs before window.on('load').

Flags: needinfo?(twisniewski)
Whiteboard: [webcompat:sightline]
Webcompat Priority: --- → P2
Webcompat Score: --- → 7

Randal, it seems like this is a good candidate for turning off timer deferring.

Flags: needinfo?(rjesup)

*.usps.com is already opted out from timer deferral

Flags: needinfo?(rjesup)

I'm going to try outreach

Flags: needinfo?(jmuizelaar)
User Story: (updated)

As chatted in the webcompat channel, I am moving the keyword from webcompat:site-wait to webcompat:contact-in-progress.
The original *:site-wait keyword was added a year ago; this may be closer to webcompat:blocked ...

User Story: (updated)

My outreach attempt failed.

Flags: needinfo?(jmuizelaar)

I'll give it a try via LinkedIn.

Flags: needinfo?(dschubert)
Whiteboard: [webcompat:sightline] → [webcompat:sightline][webcompat:core]

Raul, can you still reproduce this? I'm not be able to.

Flags: needinfo?(rbucata)

Err, never mind, I just got one.

Flags: needinfo?(rbucata)

The trick is that:

  1. From comment #0, Control+Click the link. Do not switch to the tab until it loads
  2. Switch to the tab

High chance that the page is stuck. Maybe we somehow throttle setTimeout on background tab or something?

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: