fix(dianping): correct 4 wrong cityIds in static city map (kunming/fuzhou/xiamen/hefei) - #2280
Open
fanxiaoyu0 wants to merge 1 commit into
Open
fix(dianping): correct 4 wrong cityIds in static city map (kunming/fuzhou/xiamen/hefei)#2280fanxiaoyu0 wants to merge 1 commit into
fanxiaoyu0 wants to merge 1 commit into
Conversation
The trailing rows of CITY_ID had incorrect cityIds, causing dianping search to silently fall back to the cookie's default city for these cities. Verified against live https://www.dianping.com/<slug> resolution: - kunming 昆明: 25 -> 267 - fuzhou 福州: 110 -> 14 - xiamen 厦门: 14 -> 15 - hefei 合肥: 26 -> 110 (fuzhou and hefei previously shared the same id 110, indicating the last few rows were transposed when the table was hand-written.)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The trailing rows of the curated
CITY_IDmap inclis/dianping/utils.jscontain 4 incorrect cityIds. When a user runsopencli dianping search --city <name>with one of these cities, the adapter builds the search URL with a wrong cityId.www.dianping.comdoes not recognize it, silently ignores it, and returns results for the cookie's default city instead — with no error surfaced.Notably,
fuzhouandhefeipreviously shared the same id110, indicating the last few rows were transposed when the table was hand-written.Fix
Corrected the 4 entries, verified against live resolution of
https://www.dianping.com/<slug>(reading the first/search/keyword/{id}/anchor on each city landing page):Verification
Live-checked every entry in the static map; the first 16 are correct, only these 4 were wrong:
Repro before fix (default city = Tangshan):
npx vitest run clis/dianping/dianping.test.js→ 28 passednpx tsx src/main.ts validate dianping→ PASS (4 commands, 0 errors)Scope: this map is private to the dianping adapter; no other site is affected.