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.

place-contrib: no promise in the job's condition; the OSM details test counts the community call

Maurice5cfe925b78b8
diff --git a/server/src/nest/place-contrib/place-contrib.job.ts b/server/src/nest/place-contrib/place-contrib.job.ts
index 22b2ded75..4ffee6b64 100644
--- a/server/src/nest/place-contrib/place-contrib.job.ts
+++ b/server/src/nest/place-contrib/place-contrib.job.ts
@@ -44,7 +44,7 @@ export class PlaceContribJob implements OnApplicationBootstrap {
/** One run at a time; a run asked for while one is going follows right after it. */
async send(): Promise<void> {
- if (this.running) {
+ if (this.running !== null) {
this.again = true;
return this.running;
}
diff --git a/server/tests/unit/nest/maps.service.test.ts b/server/tests/unit/nest/maps.service.test.ts
index 8ebc768b2..1b4adfc70 100644
--- a/server/tests/unit/nest/maps.service.test.ts
+++ b/server/tests/unit/nest/maps.service.test.ts
@@ -1925,12 +1925,14 @@ describe('getPlaceDetails (fetch stubbed)', () => {
expect(place.lat).toBeCloseTo(48.85);
expect(place.lng).toBeCloseTo(2.29);
expect(place.source).toBe('openstreetmap');
- // Overpass first, then Nominatim — two total fetch calls
- expect(fetchMock).toHaveBeenCalledTimes(2);
+ // Overpass first, then Nominatim, then the community values for the element
+ // from the TREK index, which answer nothing here and leave the details as they are.
+ expect(fetchMock).toHaveBeenCalledTimes(3);
const overpassUrl = fetchMock.mock.calls[0][0] as string;
const nominatimUrl = fetchMock.mock.calls[1][0] as string;
expect(overpassUrl).toContain('overpass');
expect(nominatimUrl).toContain('nominatim');
+ expect(String(fetchMock.mock.calls[2][0])).toContain('/v1/community?keys=osm%3Away%2F5');
});
it('MAPS-041e: open_now is null when regularOpeningHours.openNow is undefined', async () => {