Add UKM event for Service Worker main resource fetch handler errors [chromium/src : main]

0 views
Skip to first unread message

Yoshisato Yanagisawa (Gerrit)

unread,
Jul 15, 2026, 6:35:13 AM (7 days ago) Jul 15
to Peter Beverloo, Shunya Shishido, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, Chromium Metrics Reviews, chromium...@chromium.org, Nate Chapin, Hiroki Nakagawa, rayanka...@chromium.org, nator...@chromium.org, storage...@chromium.org, network-ser...@chromium.org, dibyapal+wa...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, blink-work...@chromium.org, bmcquad...@chromium.org, csharris...@chromium.org, gavinp...@chromium.org, horo+...@chromium.org, ipc-securi...@chromium.org, kinuko+ser...@chromium.org, kinuko...@chromium.org, loading-re...@chromium.org, loading-rev...@chromium.org, loading...@chromium.org, servicewor...@chromium.org, shimazu+se...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
Attention needed from Shunya Shishido

Yoshisato Yanagisawa voted and added 2 comments

Votes added by Yoshisato Yanagisawa

Commit-Queue+1

2 comments

Patchset-level comments
File-level comment, Patchset 18 (Latest):
Yoshisato Yanagisawa . resolved

PTAL.
I have updated the code to record the fetch() API failure in the fetch handler.

File tools/metrics/ukm/ukm.xml
Line 22305, Patchset 8: Recorded when a Service Worker fetch handler fails to load the main resource
due to a network error.
Shunya Shishido . resolved

This sounds that we're collecting metrics when the fetch handler itself fails to load. But what we want to collect is "failed to fetch" error details in `fetch()` inside the fetch handler.

Yoshisato Yanagisawa

Acknowledged

Open in Gerrit

Related details

Attention is currently required from:
  • Shunya Shishido
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I95d354e615df3c1829b417354c998aef78ca6473
Gerrit-Change-Number: 8068556
Gerrit-PatchSet: 18
Gerrit-Owner: Yoshisato Yanagisawa <yyana...@chromium.org>
Gerrit-Reviewer: Shunya Shishido <sisid...@chromium.org>
Gerrit-Reviewer: Yoshisato Yanagisawa <yyana...@chromium.org>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-CC: Hiroki Nakagawa <nhi...@chromium.org>
Gerrit-CC: Nate Chapin <jap...@chromium.org>
Gerrit-CC: Peter Beverloo <pe...@chromium.org>
Gerrit-Attention: Shunya Shishido <sisid...@chromium.org>
Gerrit-Comment-Date: Wed, 15 Jul 2026 10:34:47 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Shunya Shishido <sisid...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Shunya Shishido (Gerrit)

unread,
Jul 16, 2026, 12:34:54 AM (6 days ago) Jul 16
to Yoshisato Yanagisawa, Peter Beverloo, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, Chromium Metrics Reviews, chromium...@chromium.org, Nate Chapin, Hiroki Nakagawa, rayanka...@chromium.org, nator...@chromium.org, storage...@chromium.org, network-ser...@chromium.org, dibyapal+wa...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, blink-work...@chromium.org, bmcquad...@chromium.org, csharris...@chromium.org, gavinp...@chromium.org, horo+...@chromium.org, ipc-securi...@chromium.org, kinuko+ser...@chromium.org, kinuko...@chromium.org, loading-re...@chromium.org, loading-rev...@chromium.org, loading...@chromium.org, servicewor...@chromium.org, shimazu+se...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
Attention needed from Yoshisato Yanagisawa

Shunya Shishido added 2 comments

File third_party/blink/public/mojom/fetch/fetch_api_response.mojom
Line 66, Patchset 18 (Latest): // If the race-network-and-fetch fetch(event.request) call inside the Service
// Worker fetch handler failed with a network error, this contains net::ERR_...
int32? service_worker_race_fetch_error_code;

// If a regular (non-race) fetch() call inside the Service Worker fetch handler
// failed with a network error, this field contains the net::ERR_... code.
int32? service_worker_regular_fetch_error_code;
Shunya Shishido . unresolved

I wonder if we could consider adding these error codes to something else in ServiceWorker mojom struct as it's too much SW details and don't want to pollute `Response` struct.

For example:
1. Add a new optional param `ServiceWorkerFetchHandlerMetrics` to `OnResponse`, `OnResponseStream`, and `OnFallback`.
2. Or, simpler: append the optional error codes directly into the existing `ServiceWorkerFetchEventTiming` struct, which is already used to carry telemetry data to the browser process.

This would keep `FetchAPIResponse` fully cleanly decoupled from internal SW metrics, WDYT?

File third_party/blink/renderer/modules/service_worker/service_worker_global_scope.cc
Line 846, Patchset 18 (Latest): if (active_fetch_respond_with_observers_.size() == 1) {
active_fetch_respond_with_observers_.begin()->value->OnRegularFetchError(
net_error_code);
return;
}
if (request_data) {
for (const auto& entry : active_fetch_respond_with_observers_) {
if (entry.value->request_url() == request_data->Url()) {
entry.value->OnRegularFetchError(net_error_code);
return;
}
}
}
Shunya Shishido . unresolved

I'm concerned that relying on `size() == 1` and URL matching here introduces race conditions resulting in non-deterministic telemetry.

There are two major edge cases:
1. **False Negatives on Fallback**: If a handler does `catch(() => fetch('/offline.html'))` and it fails, `request_data->Url()` won't match `request_url()`. If `size() > 1` (concurrent navigations), the error is discarded. But if `size() == 1`, it's recorded. The same code behaves differently under load.
2. **False Positives on Background Fetches**: If a completely unrelated background fetch (e.g. from `setInterval` or a `message` event) fails, and there happens to be exactly 1 active `FetchEvent`, this will falsely attribute that unrelated error to the main resource navigation.

If threading a context/event ID into `FetchRequestData` is too complex for this CL, I'd suggest removing the `size() == 1` fallback completely and only relying on strict URL matching. While we'd intentionally miss fallback fetch errors, the behavior would at least be deterministic and free from false-positive background errors. WDYT?

Open in Gerrit

Related details

Attention is currently required from:
  • Yoshisato Yanagisawa
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I95d354e615df3c1829b417354c998aef78ca6473
    Gerrit-Change-Number: 8068556
    Gerrit-PatchSet: 18
    Gerrit-Owner: Yoshisato Yanagisawa <yyana...@chromium.org>
    Gerrit-Reviewer: Shunya Shishido <sisid...@chromium.org>
    Gerrit-Reviewer: Yoshisato Yanagisawa <yyana...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Hiroki Nakagawa <nhi...@chromium.org>
    Gerrit-CC: Nate Chapin <jap...@chromium.org>
    Gerrit-CC: Peter Beverloo <pe...@chromium.org>
    Gerrit-Attention: Yoshisato Yanagisawa <yyana...@chromium.org>
    Gerrit-Comment-Date: Thu, 16 Jul 2026 04:34:32 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Yoshisato Yanagisawa (Gerrit)

    unread,
    Jul 16, 2026, 5:18:12 AM (6 days ago) Jul 16
    to Peter Beverloo, Shunya Shishido, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, Chromium Metrics Reviews, chromium...@chromium.org, Nate Chapin, Hiroki Nakagawa, rayanka...@chromium.org, nator...@chromium.org, storage...@chromium.org, network-ser...@chromium.org, dibyapal+wa...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, blink-work...@chromium.org, bmcquad...@chromium.org, csharris...@chromium.org, gavinp...@chromium.org, horo+...@chromium.org, ipc-securi...@chromium.org, kinuko+ser...@chromium.org, kinuko...@chromium.org, loading-re...@chromium.org, loading-rev...@chromium.org, loading...@chromium.org, servicewor...@chromium.org, shimazu+se...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
    Attention needed from Shunya Shishido

    Yoshisato Yanagisawa added 2 comments

    File third_party/blink/public/mojom/fetch/fetch_api_response.mojom
    Line 66, Patchset 18: // If the race-network-and-fetch fetch(event.request) call inside the Service

    // Worker fetch handler failed with a network error, this contains net::ERR_...
    int32? service_worker_race_fetch_error_code;

    // If a regular (non-race) fetch() call inside the Service Worker fetch handler
    // failed with a network error, this field contains the net::ERR_... code.
    int32? service_worker_regular_fetch_error_code;
    Shunya Shishido . resolved

    I wonder if we could consider adding these error codes to something else in ServiceWorker mojom struct as it's too much SW details and don't want to pollute `Response` struct.

    For example:
    1. Add a new optional param `ServiceWorkerFetchHandlerMetrics` to `OnResponse`, `OnResponseStream`, and `OnFallback`.
    2. Or, simpler: append the optional error codes directly into the existing `ServiceWorkerFetchEventTiming` struct, which is already used to carry telemetry data to the browser process.

    This would keep `FetchAPIResponse` fully cleanly decoupled from internal SW metrics, WDYT?

    Yoshisato Yanagisawa

    tl;dr Option 1 was chosen.
    I understand your concern on piggyback FetchAPIResponse. I left the existing structures as-is because they are not made for carrying the error status. Let me create a new one as suggested in Option 1 instead.

    File third_party/blink/renderer/modules/service_worker/service_worker_global_scope.cc
    Line 846, Patchset 18: if (active_fetch_respond_with_observers_.size() == 1) {

    active_fetch_respond_with_observers_.begin()->value->OnRegularFetchError(
    net_error_code);
    return;
    }
    if (request_data) {
    for (const auto& entry : active_fetch_respond_with_observers_) {
    if (entry.value->request_url() == request_data->Url()) {
    entry.value->OnRegularFetchError(net_error_code);
    return;
    }
    }
    }
    Shunya Shishido . resolved

    I'm concerned that relying on `size() == 1` and URL matching here introduces race conditions resulting in non-deterministic telemetry.

    There are two major edge cases:
    1. **False Negatives on Fallback**: If a handler does `catch(() => fetch('/offline.html'))` and it fails, `request_data->Url()` won't match `request_url()`. If `size() > 1` (concurrent navigations), the error is discarded. But if `size() == 1`, it's recorded. The same code behaves differently under load.
    2. **False Positives on Background Fetches**: If a completely unrelated background fetch (e.g. from `setInterval` or a `message` event) fails, and there happens to be exactly 1 active `FetchEvent`, this will falsely attribute that unrelated error to the main resource navigation.

    If threading a context/event ID into `FetchRequestData` is too complex for this CL, I'd suggest removing the `size() == 1` fallback completely and only relying on strict URL matching. While we'd intentionally miss fallback fetch errors, the behavior would at least be deterministic and free from false-positive background errors. WDYT?

    Yoshisato Yanagisawa

    tl;dr removed size() == 1 case.
    This aims to track fetch handler failure as much as possible, but at the same time, it brings uncertainty if the fetch() is actually called from the expected fetch handler as you pointed out. Let me remove the size() == 1 to avoid that.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Shunya Shishido
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I95d354e615df3c1829b417354c998aef78ca6473
      Gerrit-Change-Number: 8068556
      Gerrit-PatchSet: 20
      Gerrit-Owner: Yoshisato Yanagisawa <yyana...@chromium.org>
      Gerrit-Reviewer: Shunya Shishido <sisid...@chromium.org>
      Gerrit-Reviewer: Yoshisato Yanagisawa <yyana...@chromium.org>
      Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
      Gerrit-CC: Hiroki Nakagawa <nhi...@chromium.org>
      Gerrit-CC: Nate Chapin <jap...@chromium.org>
      Gerrit-CC: Peter Beverloo <pe...@chromium.org>
      Gerrit-Attention: Shunya Shishido <sisid...@chromium.org>
      Gerrit-Comment-Date: Thu, 16 Jul 2026 09:17:39 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Shunya Shishido <sisid...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Shunya Shishido (Gerrit)

      unread,
      Jul 20, 2026, 11:02:24 PM (20 hours ago) Jul 20
      to Yoshisato Yanagisawa, Peter Beverloo, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, Chromium Metrics Reviews, chromium...@chromium.org, Nate Chapin, Hiroki Nakagawa, rayanka...@chromium.org, nator...@chromium.org, storage...@chromium.org, network-ser...@chromium.org, dibyapal+wa...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, blink-work...@chromium.org, bmcquad...@chromium.org, csharris...@chromium.org, gavinp...@chromium.org, horo+...@chromium.org, ipc-securi...@chromium.org, kinuko+ser...@chromium.org, kinuko...@chromium.org, loading-re...@chromium.org, loading-rev...@chromium.org, loading...@chromium.org, servicewor...@chromium.org, shimazu+se...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
      Attention needed from Yoshisato Yanagisawa

      Shunya Shishido voted Code-Review+1

      Code-Review+1
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Yoshisato Yanagisawa
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I95d354e615df3c1829b417354c998aef78ca6473
        Gerrit-Change-Number: 8068556
        Gerrit-PatchSet: 20
        Gerrit-Owner: Yoshisato Yanagisawa <yyana...@chromium.org>
        Gerrit-Reviewer: Shunya Shishido <sisid...@chromium.org>
        Gerrit-Reviewer: Yoshisato Yanagisawa <yyana...@chromium.org>
        Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
        Gerrit-CC: Hiroki Nakagawa <nhi...@chromium.org>
        Gerrit-CC: Nate Chapin <jap...@chromium.org>
        Gerrit-CC: Peter Beverloo <pe...@chromium.org>
        Gerrit-Attention: Yoshisato Yanagisawa <yyana...@chromium.org>
        Gerrit-Comment-Date: Tue, 21 Jul 2026 03:02:00 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Yoshisato Yanagisawa (Gerrit)

        unread,
        Jul 20, 2026, 11:14:35 PM (20 hours ago) Jul 20
        to Chromium IPC Reviews, Robert Kaplow, Shunya Shishido, Peter Beverloo, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, Chromium Metrics Reviews, chromium...@chromium.org, Nate Chapin, Hiroki Nakagawa, rayanka...@chromium.org, nator...@chromium.org, storage...@chromium.org, network-ser...@chromium.org, dibyapal+wa...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, blink-work...@chromium.org, bmcquad...@chromium.org, csharris...@chromium.org, gavinp...@chromium.org, horo+...@chromium.org, ipc-securi...@chromium.org, kinuko+ser...@chromium.org, kinuko...@chromium.org, loading-re...@chromium.org, loading-rev...@chromium.org, loading...@chromium.org, servicewor...@chromium.org, shimazu+se...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
        Attention needed from Chromium IPC Reviews and Robert Kaplow

        Yoshisato Yanagisawa added 1 comment

        Patchset-level comments
        Open in Gerrit

        Related details

        Attention is currently required from:
        • Chromium IPC Reviews
        • Robert Kaplow
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I95d354e615df3c1829b417354c998aef78ca6473
        Gerrit-Change-Number: 8068556
        Gerrit-PatchSet: 20
        Gerrit-Owner: Yoshisato Yanagisawa <yyana...@chromium.org>
        Gerrit-Reviewer: Chromium IPC Reviews <chrome-ip...@google.com>
        Gerrit-Reviewer: Robert Kaplow <rka...@chromium.org>
        Gerrit-Reviewer: Shunya Shishido <sisid...@chromium.org>
        Gerrit-Reviewer: Yoshisato Yanagisawa <yyana...@chromium.org>
        Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
        Gerrit-CC: Hiroki Nakagawa <nhi...@chromium.org>
        Gerrit-CC: Nate Chapin <jap...@chromium.org>
        Gerrit-CC: Peter Beverloo <pe...@chromium.org>
        Gerrit-Attention: Robert Kaplow <rka...@chromium.org>
        Gerrit-Attention: Chromium IPC Reviews <chrome-ip...@google.com>
        Gerrit-Comment-Date: Tue, 21 Jul 2026 03:14:06 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        gwsq (Gerrit)

        unread,
        Jul 20, 2026, 11:16:41 PM (19 hours ago) Jul 20
        to Yoshisato Yanagisawa, Chromium IPC Reviews, Sam McNally, Robert Kaplow, Shunya Shishido, Peter Beverloo, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, Chromium Metrics Reviews, chromium...@chromium.org, Nate Chapin, Hiroki Nakagawa, rayanka...@chromium.org, nator...@chromium.org, storage...@chromium.org, network-ser...@chromium.org, dibyapal+wa...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, blink-work...@chromium.org, bmcquad...@chromium.org, csharris...@chromium.org, gavinp...@chromium.org, horo+...@chromium.org, ipc-securi...@chromium.org, kinuko+ser...@chromium.org, kinuko...@chromium.org, loading-re...@chromium.org, loading-rev...@chromium.org, loading...@chromium.org, servicewor...@chromium.org, shimazu+se...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
        Attention needed from Robert Kaplow and Sam McNally

        Message from gwsq

        From googleclient/chrome/chromium_gwsq/ipc/config.gwsq:
        IPC: sa...@chromium.org

        📎 It looks like you’re making a possibly security-sensitive change! 📎 IPC security review isn’t a rubberstamp, so your friendly security reviewer will need a fair amount of context to review your CL effectively. Please review your CL description and code comments to make sure they provide context for someone unfamiliar with your project/area. Pay special attention to where data comes from and which processes it flows between (and their privilege levels). Feel free to point your security reviewer at design docs, bugs, or other links if you can’t reasonably make a self-contained CL description. (Also see https://cbea.ms/git-commit/).

        IPC reviewer(s): sa...@chromium.org


        Reviewer source(s):
        sa...@chromium.org is from context(googleclient/chrome/chromium_gwsq/ipc/config.gwsq)

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Robert Kaplow
        • Sam McNally
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I95d354e615df3c1829b417354c998aef78ca6473
        Gerrit-Change-Number: 8068556
        Gerrit-PatchSet: 20
        Gerrit-Owner: Yoshisato Yanagisawa <yyana...@chromium.org>
        Gerrit-Reviewer: Robert Kaplow <rka...@chromium.org>
        Gerrit-Reviewer: Sam McNally <sa...@chromium.org>
        Gerrit-Reviewer: Shunya Shishido <sisid...@chromium.org>
        Gerrit-Reviewer: Yoshisato Yanagisawa <yyana...@chromium.org>
        Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
        Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
        Gerrit-CC: Hiroki Nakagawa <nhi...@chromium.org>
        Gerrit-CC: Nate Chapin <jap...@chromium.org>
        Gerrit-CC: Peter Beverloo <pe...@chromium.org>
        Gerrit-CC: gwsq
        Gerrit-Attention: Robert Kaplow <rka...@chromium.org>
        Gerrit-Attention: Sam McNally <sa...@chromium.org>
        Gerrit-Comment-Date: Tue, 21 Jul 2026 03:16:24 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Sam McNally (Gerrit)

        unread,
        12:15 AM (18 hours ago) 12:15 AM
        to Yoshisato Yanagisawa, Sam McNally, Chromium IPC Reviews, Robert Kaplow, Shunya Shishido, Peter Beverloo, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, Chromium Metrics Reviews, chromium...@chromium.org, Nate Chapin, Hiroki Nakagawa, rayanka...@chromium.org, nator...@chromium.org, storage...@chromium.org, network-ser...@chromium.org, dibyapal+wa...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, blink-work...@chromium.org, bmcquad...@chromium.org, csharris...@chromium.org, gavinp...@chromium.org, horo+...@chromium.org, ipc-securi...@chromium.org, kinuko+ser...@chromium.org, kinuko...@chromium.org, loading-re...@chromium.org, loading-rev...@chromium.org, loading...@chromium.org, servicewor...@chromium.org, shimazu+se...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
        Attention needed from Robert Kaplow and Yoshisato Yanagisawa

        Sam McNally voted and added 2 comments

        Votes added by Sam McNally

        Code-Review+1

        2 comments

        File third_party/blink/renderer/modules/service_worker/fetch_respond_with_observer.cc
        Line 233, Patchset 20 (Latest):// This function may be called when an exception is scheduled. Thus, it must
        Sam McNally . unresolved

        Should this comment stay with `OnResponseRejected()`?

        File third_party/blink/renderer/modules/service_worker/service_worker_global_scope.cc
        Line 845, Patchset 20 (Latest): }
        Sam McNally . unresolved

        Please fix this WARNING reported by autoreview issue finding: If `request_data` has a race token but it doesn't match any `active_fetch_respond_with_observers_` (e.g. because it was already destroyed or wasn't tracked), this code will fall through to the second `if (request_data)` block. Since it's a race fetch, `request_data->Url()` will be the main resource URL, so it might accidentally match a regular fetch observer and incorrectly log the error as a `regular_fetch_error_code`.

        Consider returning early to prevent this fallback:

        ```cpp
        if (request_data && request_data->ServiceWorkerRaceNetworkRequestToken()) {
        base::UnguessableToken token =
        request_data->ServiceWorkerRaceNetworkRequestToken();

        for (const auto& entry : active_fetch_respond_with_observers_) {
              if (entry.value->race_network_request_token() &&
        *entry.value->race_network_request_token() == token) {
        entry.value->OnRaceFetchError(net_error_code);
        return;
        }
        }
        return; // <-- Do not fall through to the regular fetch URL check
        }
        ```
        Open in Gerrit

        Related details

        Attention is currently required from:
        • Robert Kaplow
        • Yoshisato Yanagisawa
        Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          • requirement satisfiedReview-Enforcement
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: I95d354e615df3c1829b417354c998aef78ca6473
          Gerrit-Change-Number: 8068556
          Gerrit-PatchSet: 20
          Gerrit-Owner: Yoshisato Yanagisawa <yyana...@chromium.org>
          Gerrit-Reviewer: Robert Kaplow <rka...@chromium.org>
          Gerrit-Reviewer: Sam McNally <sa...@chromium.org>
          Gerrit-Reviewer: Shunya Shishido <sisid...@chromium.org>
          Gerrit-Reviewer: Yoshisato Yanagisawa <yyana...@chromium.org>
          Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
          Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
          Gerrit-CC: Hiroki Nakagawa <nhi...@chromium.org>
          Gerrit-CC: Nate Chapin <jap...@chromium.org>
          Gerrit-CC: Peter Beverloo <pe...@chromium.org>
          Gerrit-CC: gwsq
          Gerrit-Attention: Robert Kaplow <rka...@chromium.org>
          Gerrit-Attention: Yoshisato Yanagisawa <yyana...@chromium.org>
          Gerrit-Comment-Date: Tue, 21 Jul 2026 04:15:20 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: Yes
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Yoshisato Yanagisawa (Gerrit)

          unread,
          2:04 AM (17 hours ago) 2:04 AM
          to Sam McNally, Chromium IPC Reviews, Robert Kaplow, Shunya Shishido, Peter Beverloo, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, Chromium Metrics Reviews, chromium...@chromium.org, Nate Chapin, Hiroki Nakagawa, rayanka...@chromium.org, nator...@chromium.org, storage...@chromium.org, network-ser...@chromium.org, dibyapal+wa...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, blink-work...@chromium.org, bmcquad...@chromium.org, csharris...@chromium.org, gavinp...@chromium.org, horo+...@chromium.org, ipc-securi...@chromium.org, kinuko+ser...@chromium.org, kinuko...@chromium.org, loading-re...@chromium.org, loading-rev...@chromium.org, loading...@chromium.org, servicewor...@chromium.org, shimazu+se...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
          Attention needed from Robert Kaplow

          Yoshisato Yanagisawa added 2 comments

          File third_party/blink/renderer/modules/service_worker/fetch_respond_with_observer.cc
          Line 233, Patchset 20:// This function may be called when an exception is scheduled. Thus, it must
          Sam McNally . resolved

          Should this comment stay with `OnResponseRejected()`?

          Yoshisato Yanagisawa

          Good catch!
          Done.

          File third_party/blink/renderer/modules/service_worker/service_worker_global_scope.cc
          Line 845, Patchset 20: }
          Sam McNally . resolved

          Please fix this WARNING reported by autoreview issue finding: If `request_data` has a race token but it doesn't match any `active_fetch_respond_with_observers_` (e.g. because it was already destroyed or wasn't tracked), this code will fall through to the second `if (request_data)` block. Since it's a race fetch, `request_data->Url()` will be the main resource URL, so it might accidentally match a regular fetch observer and incorrectly log the error as a `regular_fetch_error_code`.

          Consider returning early to prevent this fallback:

          ```cpp
          if (request_data && request_data->ServiceWorkerRaceNetworkRequestToken()) {
          base::UnguessableToken token =
          request_data->ServiceWorkerRaceNetworkRequestToken();
          for (const auto& entry : active_fetch_respond_with_observers_) {
          if (entry.value->race_network_request_token() &&
          *entry.value->race_network_request_token() == token) {
          entry.value->OnRaceFetchError(net_error_code);
          return;
          }
          }
          return; // <-- Do not fall through to the regular fetch URL check
          }
          ```
          Yoshisato Yanagisawa

          Good catch! Done.
          I assume the case can be another way "failed to fetch" happens, but I am not so confident.
          Let me leave TODO for that, while applying your suggestion.

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Robert Kaplow
          Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement is not satisfiedCode-Owners
            • requirement satisfiedCode-Review
            • requirement satisfiedReview-Enforcement
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: I95d354e615df3c1829b417354c998aef78ca6473
            Gerrit-Change-Number: 8068556
            Gerrit-PatchSet: 21
            Gerrit-Owner: Yoshisato Yanagisawa <yyana...@chromium.org>
            Gerrit-Reviewer: Robert Kaplow <rka...@chromium.org>
            Gerrit-Reviewer: Sam McNally <sa...@chromium.org>
            Gerrit-Reviewer: Shunya Shishido <sisid...@chromium.org>
            Gerrit-Reviewer: Yoshisato Yanagisawa <yyana...@chromium.org>
            Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
            Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
            Gerrit-CC: Hiroki Nakagawa <nhi...@chromium.org>
            Gerrit-CC: Nate Chapin <jap...@chromium.org>
            Gerrit-CC: Peter Beverloo <pe...@chromium.org>
            Gerrit-CC: gwsq
            Gerrit-Attention: Robert Kaplow <rka...@chromium.org>
            Gerrit-Comment-Date: Tue, 21 Jul 2026 06:03:57 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            Comment-In-Reply-To: Sam McNally <sa...@chromium.org>
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy
            Reply all
            Reply to author
            Forward
            0 new messages