Skip to content

Logic error in performance timing filtering #2476

@ToshB

Description

@ToshB

Bug Description

When performing a request which should allow performance timing, only opaque timing info is returned.

Reproducible By

  1. Perform a fetch request
  2. Check performance timing info for that request
  3. See that we only get opaque timing info, with transferSize and encodedBodySize 0.

Expected Behavior

I would expect to get timing info for the request

Environment

Node v20.9.0

Additional context

This comment describes that the timingInfo should be replaced with an opaqueTimingInfo if the "response's timing allow passed flag is not set", but the code checks timingInfo.timingAllowPassed, which doesn't seem to be set anywhere.
However, the response's timingAllowPassed flag is set here.

Could it be that the code should as follows? This seems to fix my problem.

  if (!response.timingAllowPassed) {
    //  1. Set timingInfo to a the result of creating an opaque timing info for timingInfo.
    timingInfo = createOpaqueTimingInfo({
      startTime: timingInfo.startTime
    })
    ...
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions