From fa0f544e3f881d77159425e99526f0444146c03c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Sun, 17 May 2026 12:41:34 +0200 Subject: [PATCH] fix(audit): fall back to city/country when ASN lookup misses MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The carrier chip on the admin login-overview audit table was empty whenever the offline GeoLite2-ASN MMDB had no entry for the IP. In practice this is every IP behind a non-DACH or cloud-NAT range — the free-tier MMDB carries DACH carriers densely but thins out elsewhere — and the chip went blank even though the city + country were already populated from the parallel location lookup. When `entry.carrier` is null but `entry.location` is non-null, render the chip with the city/country string and a "carrier unavailable" qualifier. Private/loopback IPs still hide the chip entirely (both columns null). --- messages/de.json | 3 +- messages/en.json | 3 +- messages/es.json | 3 +- messages/fr.json | 3 +- messages/it.json | 3 +- messages/pl.json | 3 +- .../admin/login-overview-section.tsx | 28 ++++++++++++++----- 7 files changed, 33 insertions(+), 13 deletions(-) diff --git a/messages/de.json b/messages/de.json index 2ac02982f..7e07ce291 100644 --- a/messages/de.json +++ b/messages/de.json @@ -2445,7 +2445,8 @@ } }, "carrier": "Anbieter", - "carrierUnknown": "Unbekannter Anbieter" + "carrierUnknown": "Unbekannter Anbieter", + "carrierUnavailableGeoFallback": "{location} — Anbieter nicht verfügbar" }, "achievements": { "title": "Erfolge", diff --git a/messages/en.json b/messages/en.json index 8c948adcd..d1d71ffb8 100644 --- a/messages/en.json +++ b/messages/en.json @@ -2445,7 +2445,8 @@ } }, "carrier": "Carrier", - "carrierUnknown": "Unknown carrier" + "carrierUnknown": "Unknown carrier", + "carrierUnavailableGeoFallback": "{location} — carrier unavailable" }, "achievements": { "title": "Achievements", diff --git a/messages/es.json b/messages/es.json index 79fe0560b..e2d1f7cc1 100644 --- a/messages/es.json +++ b/messages/es.json @@ -2445,7 +2445,8 @@ } }, "carrier": "Operador", - "carrierUnknown": "Operador desconocido" + "carrierUnknown": "Operador desconocido", + "carrierUnavailableGeoFallback": "{location} — carrier unavailable" }, "achievements": { "title": "Achievements", diff --git a/messages/fr.json b/messages/fr.json index b73b6cd22..8973ac0b4 100644 --- a/messages/fr.json +++ b/messages/fr.json @@ -2445,7 +2445,8 @@ } }, "carrier": "Opérateur", - "carrierUnknown": "Opérateur inconnu" + "carrierUnknown": "Opérateur inconnu", + "carrierUnavailableGeoFallback": "{location} — carrier unavailable" }, "achievements": { "title": "Achievements", diff --git a/messages/it.json b/messages/it.json index fa665b2ce..98df87416 100644 --- a/messages/it.json +++ b/messages/it.json @@ -2445,7 +2445,8 @@ } }, "carrier": "Operatore", - "carrierUnknown": "Operatore sconosciuto" + "carrierUnknown": "Operatore sconosciuto", + "carrierUnavailableGeoFallback": "{location} — carrier unavailable" }, "achievements": { "title": "Achievements", diff --git a/messages/pl.json b/messages/pl.json index b17f4c127..db35bcb93 100644 --- a/messages/pl.json +++ b/messages/pl.json @@ -2445,7 +2445,8 @@ } }, "carrier": "Operator", - "carrierUnknown": "Nieznany operator" + "carrierUnknown": "Nieznany operator", + "carrierUnavailableGeoFallback": "{location} — carrier unavailable" }, "achievements": { "title": "Achievements", diff --git a/src/components/admin/login-overview-section.tsx b/src/components/admin/login-overview-section.tsx index 57a20891a..05c4072af 100644 --- a/src/components/admin/login-overview-section.tsx +++ b/src/components/admin/login-overview-section.tsx @@ -452,13 +452,17 @@ export function LoginOverviewSection() { {/* v1.4.27 B3 — carrier chip below the auth-provider - chip. Only renders when the GeoLite2-ASN lookup - found an organisation string for the audit-row's - IP; private/loopback IPs and offline-miss rows - keep the original single-chip layout. The chip - carries the short DACH label ("Telekom", - "Vodafone", "1&1", "O2"); unknown organisations - fall through to the raw GeoLite2 string. + chip. v1.4.36 W4g — fall back to the city + country + string with a "carrier unavailable" qualifier when + the GeoLite2-ASN offline lookup miss (free-tier + ipwho.is does not expose ASN) leaves `entry.carrier` + null but the location lookup populated + `entry.location`. Private/loopback IPs and offline- + miss rows on BOTH columns keep the original + single-chip layout. ASN-known chip carries the + short DACH label ("Telekom", "Vodafone", "1&1", + "O2") with unknown organisations falling through + to the raw GeoLite2 string. */} {entry.carrier ? ( {carrierShortLabel(entry.carrier)} + ) : entry.location ? ( + + {t("admin.carrierUnavailableGeoFallback", { + location: entry.location, + })} + ) : null}