* Exact replica of the OLD key computation from upstream main. * Uses sanitize() for paths - this is what had the collision bug.
(
resourceId: number,
path: string | null,
pathMatchType: string | null,
rewritePath: string | null,
rewritePathType: string | null
)
| 27 | * Uses sanitize() for paths - this is what had the collision bug. |
| 28 | */ |
| 29 | function oldKeyComputation( |
| 30 | resourceId: number, |
| 31 | path: string | null, |
| 32 | pathMatchType: string | null, |
| 33 | rewritePath: string | null, |
| 34 | rewritePathType: string | null |
| 35 | ): string { |
| 36 | const targetPath = sanitize(path) || ""; |
| 37 | const pmt = pathMatchType || ""; |
| 38 | const rp = rewritePath || ""; |
| 39 | const rpt = rewritePathType || ""; |
| 40 | const pathKey = [targetPath, pmt, rp, rpt].filter(Boolean).join("-"); |
| 41 | const mapKey = [resourceId, pathKey].filter(Boolean).join("-"); |
| 42 | return sanitize(mapKey) || ""; |
| 43 | } |
| 44 | |
| 45 | /** |
| 46 | * Replica of the NEW key computation from our fix. |