Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions argus-app/src/app/api/feeds/adsb/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { dynamic, GET } from "../adsb-military/route";
1 change: 1 addition & 0 deletions argus-app/src/app/api/feeds/ais/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { dynamic, GET } from "../aisstream/route";
6 changes: 4 additions & 2 deletions argus-app/src/app/api/feeds/aisstream/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ type WsConstructor = new (
let cache: AisCache | null = null;
const CACHE_TTL_MS = 45_000; // Serve cached data for 45s to avoid hammering the WebSocket

const REQUEST_TIMEOUT_MS = Number(process.env.AISSTREAM_TIMEOUT_MS ?? 40000);
const REQUEST_TIMEOUT_MS = Number(process.env.AISSTREAM_TIMEOUT_MS ?? 12000);
const MAX_MESSAGES = Number(process.env.AISSTREAM_MAX_MESSAGES ?? 2000);

function rawDataToString(data: unknown): string {
Expand Down Expand Up @@ -197,7 +197,9 @@ async function fetchSnapshotFromWs(apiKey: string): Promise<AisPayload> {
export async function GET() {
const apiKey = process.env.AISSTREAM_API_KEY;
if (!apiKey) {
return NextResponse.json({ error: "AISSTREAM_API_KEY not configured" }, { status: 500 });
const message = "AISSTREAM_API_KEY not configured";
reportFeedHealth("aisstream", "error", message);
return NextResponse.json({ vessels: [], _degraded: true, _source: "ais-empty", _reason: message });

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve AIS missing-key failure semantics

When AISSTREAM_API_KEY is unset, this now returns HTTP 200 with an empty vessels array even though the server records an error. The existing client only throws on non-OK responses in argus-app/src/lib/ingest/aisstream.ts:23-25, so the polling path in CesiumGlobe.tsx:1783-1786 will treat the missing credential as a successful AIS refresh and mark the feed healthy with zero vessels. Please keep a non-2xx status here or update the client to treat _degraded as a feed error/degraded state.

Useful? React with 👍 / 👎.

}

// Return cached data if still fresh
Expand Down
1 change: 1 addition & 0 deletions argus-app/src/app/api/feeds/tle/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { dynamic, GET } from "../celestrak/route";