- From: Yoshisato Yanagisawa <notifications@github.com>
- Date: Fri, 31 Jan 2025 02:21:10 -0800
- To: w3c/ServiceWorker <ServiceWorker@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Friday, 31 January 2025 10:21:14 UTC
I guess the way to count conditions may need some discussions. I and @sisidovski agreed in the following way, though.
We count the following as 1 condition and 1 depth because there is only `RouterCondition` even if some of its properties are set.
```
event.addRoutes({
condition: {
urlPattern: { pathname: "/form/*" },
requestMethod: "post",
requestMode: "navigation",
runningStatus: "running"
},
source: "network"
});
```
However, we count the following as 5 conditions and 2 max depths because 4 `RouterCondition`s in the top-level `RouterCondition`.
```
event.addRoutes({
condition: {
or: [
{urlPattern: { pathname: "/form/*" }},
{requestMethod: "post"},
{requestMode: "navigation"},
{runningStatus: "running"}
]},
source: "network"
});
```
Please see the description of https://github.com/w3c/ServiceWorker/pull/1752 for details. Yes, I understand 1024 max conditions are decided upon our intuition, and it might be good to revisit later.
--
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/issues/1746#issuecomment-2626852397
You are receiving this because you are subscribed to this thread.
Message ID: <w3c/ServiceWorker/issues/1746/2626852397@github.com>
Received on Friday, 31 January 2025 10:21:14 UTC