Skip to content

PerformanceResourceTiming responseStatus field is reported as undefined #4105

@psimk

Description

@psimk

Bug Description

When observing type: 'resource' using PerformanceObserver, the resource entry reported for the fetch initiatorType has its responseStatus field set to undefined.

Reproducible By

Execute ⬇ down using node.

const { PerformanceObserver } = require('perf_hooks')
const { fetch } = require('undici')
const { createServer } = require('http')

createServer((req, res) => {
  res.statusCode = 200
  res.end('Hello World')
}).listen(3000)

new PerformanceObserver(items => {
  items.getEntries().forEach(entry => {
    console.log(entry)
  })
}).observe({ type: 'resource', buffered: true })

fetch('http://localhost:3000').then(async response => {
  await response.text()
  setTimeout(() => {
    process.exit()
  })
})

Expected Behavior

The server responded with a 200, so I expect responseStatus to also be 200.

Logs & Screenshots

Image

Environment

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.3.0: Thu Jan  2 20:24:16 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T6000
  Available memory (MB): 32768
  Available CPU cores: 10
Binaries:
  Node: 23.6.1

Additional context

I performed some light debugging and found that fetchParams.controller.reportTimingSteps is never called. I also cannot find any reference to reportTimingSteps in Node or Undici.

Performing a similar test in the Chromium browser returns the expected status code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions