What is the problem?
The IPInfo popup does not show the country the IP is in.
It only shows city, state, region, etc.
| dom_walden | |
| Nov 6 2020, 2:06 PM |
| F34754084: Screen Shot 2021-11-18 at 11.30.02 AM.png | |
| Nov 18 2021, 4:31 PM |
| F34754087: Screen Shot 2021-11-18 at 11.31.46 AM.png | |
| Nov 18 2021, 4:31 PM |
The IPInfo popup does not show the country the IP is in.
It only shows city, state, region, etc.
Quoting @dom_walden from Slack earlier:
Moreover, the bug I raised was for GeoLite2. I have not tested Enterprise yet.
But I suspect (reading the code) for GeoLite2 it is still happening.
For example, the IP 216.38.130.164 in https://en.wikipedia.beta.wmflabs.org/w/index.php?title=Main_Page&action=history only says Redwood City, California
In the interests of not leaking data about an ip, I tested another ip against the free and enterprise databases. For reference, we currently:
From City.mmdb (with non-en translations and non-location information removed):
"Records": [
{
"Record": {
"city": {
"geoname_id": 2640101,
"names": {
"en": "Poole",
}
},
"continent": {
"code": "EU",
"geoname_id": 6255148,
"names": {
"en": "Europe",
}
},
"country": {
"geoname_id": 2635167,
"iso_code": "GB",
"names": {
"en": "United Kingdom",
}
},
"registered_country": {
"geoname_id": 2635167,
"iso_code": "GB",
"names": {
"en": "United Kingdom",
}
},
"subdivisions": [
{
"geoname_id": 6269131,
"iso_code": "ENG",
"names": {
"en": "England",
}
},
{
"geoname_id": 12165737,
"iso_code": "BCP",
"names": {
"en": "Bournemouth, Christchurch and Poole Council"
}
}
]
}
}
]From the Enterprise.mmdb (similarly redacted):
"Records": [
{
"Record": {
"city": {
"geoname_id": 2640101,
"names": {
"en": "Poole", }
},
"continent": {
"code": "EU",
"geoname_id": 6255148,
"names": {
"en": "Europe",
}
},
"country": {
"geoname_id": 2635167,
"iso_code": "GB",
"names": {
"en": "United Kingdom",
}
},
"registered_country": {
"geoname_id": 2635167,
"iso_code": "GB",
"names": {
"en": "United Kingdom",
}
},
"subdivisions": [
{
"geoname_id": 6269131,
"iso_code": "ENG",
"names": {
"en": "England",
}
},
{
"geoname_id": 12165737,
"iso_code": "BCP",
"names": {
"en": "Bournemouth, Christchurch and Poole Council"
}
}
],
}
}
],So we do have information about the country in both databases and can access them in similar ways. It would have to be appended to the array_merge that happens at the end of getLocations. Right now the location returns as "Poole, Bournemouth, Christchurch and Poole Council, England" and we'd expect after this fix to show "Poole, Bournemouth, Christchurch and Poole Council, England, United Kingdom"
Change 732838 had a related patch set uploaded (by AGueyte; author: AGueyte):
[mediawiki/extensions/IPInfo@master] Show country in the popup
Change 737750 had a related patch set uploaded (by AGueyte; author: AGueyte):
[mediawiki/extensions/IPInfo@master] Show country in the popup and infobox
Change 732838 abandoned by AGueyte:
[mediawiki/extensions/IPInfo@master] Show country in the popup and infobox
Reason:
Change 737750 merged by jenkins-bot:
[mediawiki/extensions/IPInfo@master] Show country in the popup and infobox