- From: Shunya Shishido <notifications@github.com>
- Date: Sun, 02 Feb 2025 21:26:49 -0800
- To: w3c/ServiceWorker <ServiceWorker@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <w3c/ServiceWorker/pull/1752/review/2588943120@github.com>
@sisidovski commented on this pull request. > + :: |routerRules|, a [=list of router rules=] + : Output + :: a boolean + + Note: Router conditions can be complex and nested using {{RouterCondition/_or}} and {{RouterCondition/not}}. To prevent excessive processing, this algorithm introduces two limits. First, the total number of conditions, counting all nested conditions, cannot exceed 1024. Second, the nesting depth is limited to 10 levels to avoid exponential computation. + + 1. Let |result| be a [=count router condition result=]. + 1. Set |result|'s [=count router condition result/total count=] to 0. + 1. Set |result|'s [=count router condition result/depth=] to 1. + 1. Let |maxCount| be 1024. + 1. Let |maxDepth| be 10. + 1. [=list/For each=] |rule| of |routerRules|: + 1. Let |currentResult| be the result of running [=Count Router Inner Conditions=] with |rule|["{{RouterRule/condition}}"], |result|, |maxCount|, and |maxDepth|. + 1. If |currentResult|'s [=count router condition result/total count=] exceeds |maxCount|, return false. + 1. If |currentResult|'s [=count router condition result/depth=] exceeds |maxDepth|, return false. + 1. Set |result|'s [=count router condition result/total count=] to |currentResult|'s [=count router condition result/total count=]. Maybe we need to have a `Note:` why this step is needed? -- Reply to this email directly or view it on GitHub: https://github.com/w3c/ServiceWorker/pull/1752#pullrequestreview-2588943120 You are receiving this because you are subscribed to this thread. Message ID: <w3c/ServiceWorker/pull/1752/review/2588943120@github.com>
Received on Monday, 3 February 2025 05:26:53 UTC