Skip to content

SearchBox: fix crash from id-tagging-schema@7.0.0 - #1503

Merged
zbycz merged 2 commits into
masterfrom
claude/cherry-pick-prs-120-122-so4pkx
Jul 13, 2026
Merged

SearchBox: fix crash from id-tagging-schema@7.0.0#1503
zbycz merged 2 commits into
masterfrom
claude/cherry-pick-prs-120-122-so4pkx

Conversation

@zbycz

@zbycz zbycz commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Cherry-picked from openclimbing: fixes a SearchBox crash caused by an unpinned id-tagging-schema CDN upgrade, and pins the CDN/package version to 7.x to prevent recurrence.

Checklist

  • dark mode / light mode
  • mobile / desktop
  • server-side-rendering (SSR) - n/a, client-only search code
  • all texts are localized (in vocabulary.ts) - n/a, no new UI text

Generated by Claude Code

zbycz added 2 commits July 13, 2026 15:16
### Description

`@openstreetmap/id-tagging-schema` translations are fetched from CDN
unpinned (always `latest`). Upstream changed `terms` from a
comma-separated string to a `string[]` — confirmed on the live CDN data:
1324 of 1731 presets now have `terms` as an array.
`getPresetTermsTranslation()` still called `.split(',')` on it, throwing
for almost every preset and breaking SearchBox preset search entirely
(Sentry: `TypeError: (0, y.MG).split is not a function`, ~1800+ events).

- `getPresetTermsTranslation()` now normalizes both shapes (array
passthrough, legacy string gets split, missing → `[]`) and returns
`string[]` directly.
- Removed the now-redundant `.split(',')` at the call site in
`preset.tsx`.
- Added `translations.test.ts` covering all 4 cases (array, legacy
string, missing terms, unknown preset key).

### Checklist

- [x] server-side-rendering (SSR) - n/a, client-only search code
- [x] all texts are localized (in vocabulary.ts) - n/a, no new UI text

https://claude.ai/code/session_01YChsE67uVMznndDeUHwbwA

---
_Generated by [Claude
Code](https://claude.ai/code/session_01YChsE67uVMznndDeUHwbwA)_

---------

(cherry picked from commit 2f7c69f032460819f8ee961b070ee555f5c87ccd)
The CDN fetch for `id-tagging-schema` translations was unpinned (always
`latest`), which is how a breaking change (`terms` string → string[])
reached production unannounced and broke SearchBox (#120). Pins the CDN
URL to `7.x` and bumps the npm dependency to match, so we still get
updates but a future `8.0.0` won't silently break us again.

- CDN fetch now resolves `@7` instead of unpinned latest.
- `package.json`/`yarn.lock`: `@openstreetmap/id-tagging-schema` 6.12.0
→ 7.0.1.
- 7.x ships `.d.json.ts` declarations for its JSON exports - added
`allowArbitraryExtensions` to `tsconfig.json` so `tsc` picks them up.
- Updated one test snapshot for the resulting (alphabetical) field order
from the schema bump.

https://claude.ai/code/session_01YChsE67uVMznndDeUHwbwA

---
_Generated by [Claude
Code](https://claude.ai/code/session_01YChsE67uVMznndDeUHwbwA)_

(cherry picked from commit af0abc989cd0960352dbc1474b7761e709cfb6ef)
@vercel

vercel Bot commented Jul 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
osmapp-preview Ready Ready Preview Jul 13, 2026 3:29pm

@zbycz zbycz changed the title tagging: fix SearchBox crash from id-tagging-schema@7.0.0 + pin CDN to 7.x SearchBox: fix crash from id-tagging-schema@7.0.0 Jul 13, 2026
@zbycz
zbycz merged commit 6ff668d into master Jul 13, 2026
5 checks passed
@zbycz
zbycz deleted the claude/cherry-pick-prs-120-122-so4pkx branch July 13, 2026 15:39
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