fix(ski-routing): sort the network cache key by code unit, not by default

This commit is contained in:
Maurice
2026-10-20 23:18:54 +02:00
parent 0dda5bc3e9
commit 988890866a
@@ -56,7 +56,8 @@ export class NetCache {
constructor(private readonly budget = NETWORK_BUDGET_BYTES) {}
get(files: readonly string[]): Promise<SkiRouter> {
const key = [...files].sort().join('|');
// Code unit order, so the key never depends on a locale.
const key = [...files].sort((a, b) => (a < b ? -1 : a > b ? 1 : 0)).join('|');
const known = this.routers.get(key);
if (known) {
this.routers.delete(key);