Repository navigation
Conversation
Elsewhen geocoded city names and matched the result zone against the row's zone id. A legacy alias such as Asia/Calcutta never matches the geocoder's Asia/Kolkata, so the top result was adopted instead: a Calcutta in South Africa, putting the marker in Mpumalanga. Resolve tzdata links from tzdata.zi before matching, accept only a geocode in the row's own (canonical) zone, and read the offline zone table by the canonical name unless the link crosses a country border. Backported from open PR omacom#17855 by Anandakrishnan CV. Co-authored-by: Anandakrishnan CV <ananducv666@gmail.com>
[Medium impact] The PR appears safe to merge; no actionable issues remain in the reviewed changes. SummaryElsewhen resolves legacy time-zone names before choosing coordinates and rejects geocoder results from unrelated zones.
Reviews (2) · Last reviewed commit: "Keep Jan Mayen outside its shared clock ..." · Reviewed by Greptile |
|
GPT-6 XHigh in Codex reviewed the diff, the Elsewhen call site, the linked report #19084, and the release branch's contributor rules. I classify this as a bug fix, but the configured classification model, deepseek-v4p1-flash, returned no classification, so the two-model classification remains unsettled. The review service health check answered; no second code review or tests ran. This is waiting for the classification check to be resolved before verification can proceed. |
The country table inherits Germany from the compiled timezone link. Elsewhen now uses that table to guard geographic fallbacks, so the inherited value sends Jan Mayen to Berlin when geocoding fails. Override it with the country of the place and cover the actual model and greeting-table integration. Co-Authored-By: GPT-6 XHigh <noreply@openai.com> Co-Authored-By: Opus 5.5 High <noreply@anthropic.com>
|
GPT-6 XHigh in Codex reproduced the Calcutta error on an ISO worker using the live geocoder and installed timezone data: the base selected South Africa at -24.98317, 31.23485; this head selected Kolkata at 22.5333, 88.3667. Reverting the fix restored the error. CLI and all six Elsewhen test files passed on the corrected tree (515 checks). Opus 5.5 High found that Jan Mayen's existing country entry let the new fallback place it in Berlin. I pushed 5ba6e92e to keep Jan Mayen in its own country; this also corrects its greeting from German to Norwegian. The integration regression fails without that correction. Opus 5.5 High and muse-wonder via pi, thinking high reviewed the corrected head and agreed this correction is contained; independence is not guaranteed. One policy decision remains: when geocoding fails or finds no matching zone, same-country aliases still use another city's representative coordinates, including Montreal → Toronto and Currie → Hobart. Both reviewers left choosing that behavior versus a curated rename list to the maintainer. This PR also targets Before, on the base: Calcutta's marker in southern Africa. After, on the tested head: Calcutta's marker in India. These captures establish the marker location; they do not establish weather forecast accuracy. |


Fixes #19084. Backport of the approach in #17855 (by @anandude) to the 4.5 release branch.
Root cause
Elsewhen geocodes a city by name and accepts the top result when none of the results carries the row's zone id.
Asia/Calcuttais a legacy tzdata link; the geocoder answers with the canonicalAsia/Kolkata, so no result matches — and the top result for "Calcutta" is a hamlet in Mpumalanga, South Africa. That is exactly where the marker lands in the report. The offlinezone1970.tabfallback had the same problem: it lists only canonical ids, soAsia/Calcuttafound nothing either.Confirmed against the live API:
What changes
zoneAliases()reads theL <canonical> <alias>lines of/usr/share/zoneinfo/tzdata.ziat runtime, so new/changed links need no code update.canonicalZone()resolves a row's zone through those links;pickGeocode()accepts only a geocode result in the row's canonical zone, so a same-named town on another continent is never adopted.zoneTabCoords()still provides the offline fallback by canonical zone, guarded byfallbackZone()so a link that crosses a country border (e.g.Pacific/Truk→Pacific/Port_Moresby) does not silently move a city to another country.Panel.qmlloadstzdata.ziand passes the aliases into the geocode handler.Verification
Asia/Calcuttacanonicalizes toAsia/Kolkata, the South-Africa geocode is rejected, and the zone table places the city at 22.58, 88.37 (Kolkata, India).test/shell.d/elsewhen-model-test.shfail on the base branch and pass with the fix; all sixelsewhen-*-test.shfiles pass.git diff --checkclean.Fixes #17782