Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

fix(native): sort the offline manifest with localeCompare, so Sonar's reliability gate holds

Mauriceb008e010a53d
diff --git a/client/src/native/offlineShell.ts b/client/src/native/offlineShell.ts
index e30b9b1d3..8bc1bf6bd 100644
--- a/client/src/native/offlineShell.ts
+++ b/client/src/native/offlineShell.ts
@@ -88,7 +88,7 @@ export async function keepOfflineShellFresh(fetchImpl: typeof fetch = fetch, lan
if (!response.ok) return;
const files = manifestFiles(await response.json(), language);
// The build and the language together: a new language needs its own chunk.
- const build = `${[...files].sort().find((f) => /index-[^/]+\.js$/.test(f)) ?? files.length}:${language ?? 'en'}`;
+ const build = `${[...files].sort((a, b) => a.localeCompare(b)).find((f) => /index-[^/]+\.js$/.test(f)) ?? files.length}:${language ?? 'en'}`;
if (warmedBuild() === build) return;
const complete = await warmCache(files, (path) =>
fetchImpl(path, { priority: 'low' } as RequestInit).then((r) => r.blob())