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(flight-live): sort attribution sources with an explicit compare

Mauricee1e8c4c63d89
diff --git a/server/src/nest/flight-live/flight-live.service.ts b/server/src/nest/flight-live/flight-live.service.ts
index 26d8f75eb..89c45a635 100644
--- a/server/src/nest/flight-live/flight-live.service.ts
+++ b/server/src/nest/flight-live/flight-live.service.ts
@@ -138,7 +138,9 @@ export class FlightLiveService {
/** The credit line for what the answer shows: the sources its legs were read from, else the first source. */
private attributionFor(flights: readonly FlightLiveLeg[]): string {
- const sources = [...new Set(flights.flatMap((f) => (f.source ? [f.source] : [])))].sort();
+ const sources = [...new Set(flights.flatMap((f) => (f.source ? [f.source] : [])))].sort((a, b) =>
+ a.localeCompare(b),
+ );
if (sources.length === 0) return this.feeds.attribution();
return sources.map((source) => FEED_ATTRIBUTION[source]).join('; ');
}