Skip to content

fix: show country code when city is unavailable in location display#20

Open
Boanerges1996 wants to merge 1 commit intopeermetrics:masterfrom
Boanerges1996:fix/location-fallback-country-code
Open

fix: show country code when city is unavailable in location display#20
Boanerges1996 wants to merge 1 commit intopeermetrics:masterfrom
Boanerges1996:fix/location-fallback-country-code

Conversation

@Boanerges1996
Copy link
Copy Markdown
Contributor

Summary

  • The location computed property in participantsCard.vue required both city and country_code to be non-null before rendering a location string
  • ipstack (and AppEngine geo headers) do not always return a city — VPN exit nodes, corporate proxies, and certain ISP IP ranges are often only mapped to a country
  • Participants in those cases showed "Location: -" even though valid country data was available
  • Fix: fall back to country_code alone when city is null

Before: "Location: -" for any participant where city is unknown
After: "Location: DE" (or whichever country) when only country is known, "Location: Berlin, DE" when both are available

Test plan

  • Join from a VPN or corporate network — confirm location now shows at least the country code
  • Join from a regular connection with city-level data — confirm full City, CC format is unchanged
  • Confirm that participants with no geo data at all still show "Location: -"

🤖 Generated with Claude Code

ipstack and AppEngine geo headers do not always include a city (e.g. for
VPN, corporate proxy, or certain ISP IP ranges). Fall back to country_code
alone so participants from those networks show a location rather than '-'.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant