Bug 188620

Summary: Navigation Timing API reporting below 0 for response time (responseEnd - responseStart)
Product: WebKit Reporter: msartintarm
Component: WebCore Misc.Assignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Major CC: achristensen, ap, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: iPhone / iPad   
OS: iOS 11   

Description msartintarm 2018-08-15 14:16:33 PDT
I work on a site with millions of hits per day. We collect latency data and make assertions on the results client-side before using them in aggregate metrics.

We are receiving invalid metrics from the Safari browser for various iPhone / iPad devices using iOS 10 and 11.

The following interval is showing up as below 0 in many instances:

`performance.timing.responseEnd - performance.timing.responseStart`

In some cases the number is significantly below 0. It doesn't seem like it would ever make sense for this number to be below 0.

We collect samples of performance.timing data for which these errors occur. Here is a sample where responseEnd - responseStart is -28412:

{"navigationStart":1534229958311,"unloadEventStart":0,"unloadEventEnd":0,"redirectStart":0,"redirectEnd":0,"fetchStart":1534229958311,"domainLookupStart":1534229958311,"domainLookupEnd":1534229958311,"connectStart":1534229958311,"connectEnd":1534229958311,"secureConnectionStart":0,"requestStart":1534229958313,"responseStart":1534229958435,"responseEnd":1534229930023,"domLoading":1534229958326,"domInteractive":1534229958585,"domContentLoadedEventStart":1534229958585,"domContentLoadedEventEnd":1534229958585,"domComplete":1534229961509,"loadEventStart":1534229961510,"loadEventEnd":1534229961510}


	sub_family: "AppleWebKit"
	platform: "iPad"
	device: "iPad"
	os: "CPU OS 10_3_3 like Mac OS X"
	browser: "Safari"
	browser_version: "10.0"
	browser_engine_version: "603.3.8"

Let me know if there is any additional analysis / info I can attach that would be helpful.
Comment 1 msartintarm 2018-08-15 14:18:10 PDT
This does not appears to be occuring with high frequency in browsers other than Safari / devices other than iOS.
Comment 2 Radar WebKit Bug Importer 2018-08-17 16:54:13 PDT
<rdar://problem/43445161>
Comment 3 msartintarm 2018-08-28 14:54:17 PDT
I have determined that it is iPads with the latest versions of iOS which are throwing this error.

I found this out by analyzing our metrics and segmenting them per user agent. 

Around 50% (!) of reports from iPads using iOS 10.0 and 11.0 are throwing this error. This is across millions of daily hits.. basically each browser session on iPad has a 50% chance of reporting responseStart / responseEnd numbers which are invalid.

I do not see any other iOS device throwing errors at a rate of above 0.5%.