Skip to content

fix(core): canonicalize default MapLibre glyph URLs - #4490

Draft
fallenmi wants to merge 1 commit into
maplibre:mainfrom
fallenmi:agent/fix-maplibre-glyph-template
Draft

fix(core): canonicalize default MapLibre glyph URLs#4490
fallenmi wants to merge 1 commit into
maplibre:mainfrom
fallenmi:agent/fix-maplibre-glyph-template

Conversation

@fallenmi

Copy link
Copy Markdown

Summary

Root cause

createTokenMap expands only its generic URL placeholders. The default MapLibre glyph template contained {fontstack}, {start}, and {end}, so those braces reached std::regex and could raise std::regex_error while an offline pack was being prepared.

This change is intentionally scoped to the default MapLibre/demotiles configuration. It does not broaden the generic template parser for arbitrary custom glyph templates.

Fixes #4403.

Validation

  • confirmed the new MapLibre.CanonicalURL regression throws std::regex_error before the source change
  • passed the focused regression 100 consecutive times after the change
  • passed 22 adjacent Mapbox, MapLibre, MapTiler, and TileServerOptions URL tests
  • passed ClangFormat 20.1.8, targeted pre-commit whitespace/line-ending hooks, and git diff --check

The full project suite was not completed locally; remote CI is pending.

AI assistance disclosure

OpenAI Codex (GPT-5) assisted with investigation, test drafting, implementation, validation, and this draft description. The contributor must personally review every changed line and approve or rewrite this description before marking the PR ready for review.

Generated-by: OpenAI Codex (GPT-5)
@github-actions github-actions Bot added the core Changes that affect the C++ core of MapLibre Native label Aug 15, 2026
@miakh

miakh commented Aug 28, 2026

Copy link
Copy Markdown

Confirmed this fixes josxha/flutter-maplibre#535: I reproduced the old std::regex_error and verified the merged fix plus 22 adjacent URL tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Changes that affect the C++ core of MapLibre Native

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Uncaught std::regex_error in createTokenMap aborts the app during offline pack download when style glyphs are hosted on demotiles.maplibre.org

2 participants