Skip to content

Fix encoded glyph paths for object storage - #236

Merged
Kanahiro merged 3 commits into
mainfrom
codex/fix-encoded-glyph-paths
Aug 18, 2026
Merged

Fix encoded glyph paths for object storage#236
Kanahiro merged 3 commits into
mainfrom
codex/fix-encoded-glyph-paths

Conversation

@Kanahiro

Copy link
Copy Markdown
Owner

Summary

  • decode percent-encoded source paths before loading glyphs from S3 and GCS
  • fall back to the literal encoded key when it exists for backward compatibility
  • share the path-resolution policy with the existing filesystem source
  • add regression coverage for spaces, multi-font commas, malformed encoding, and non-not-found errors

Root cause

MapLibre Native percent-encodes {fontstack} before passing glyph URLs to the source resolver. S3 and GCS treated that encoded value as a literal object key, so font stacks containing spaces or commas could not be found.

Decoded paths are attempted first because they are the normal MapLibre glyph case and avoid an extra not-found request for every glyph range. Literal encoded keys remain available as a fallback.

Validation

  • npm run check
  • npm run test:unit -- --run (42 tests passed)
  • git diff --check

Closes #235

@codecov

codecov Bot commented Aug 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.39%. Comparing base (da210ed) to head (7df6b82).
⚠️ Report is 11 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #236      +/-   ##
==========================================
+ Coverage   51.98%   56.39%   +4.41%     
==========================================
  Files          27       28       +1     
  Lines         629      633       +4     
  Branches      163      163              
==========================================
+ Hits          327      357      +30     
+ Misses        261      238      -23     
+ Partials       41       38       -3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Kanahiro
Kanahiro marked this pull request as ready for review August 18, 2026 15:03
@github-actions

github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown

Benchmark

Comparison: main → this PR (same runner, same environment).

Scenario Req/s (higher is better) p50 ms (lower is better) p99 ms (lower is better)
png c=1 +0.0% (12.0 → 12.0) +0.0% (81.0 → 81.0) -3.2% (95.0 → 92.0)
png c=10 +0.8% (11.9 → 12.0) -0.3% (715.0 → 713.0) +1.7% (1659.0 → 1687.0)
webp c=1 -0.9% (11.0 → 10.9) +1.2% (86.0 → 87.0) +2.1% (95.0 → 97.0)
jpeg c=1 +0.0% (12.1 → 12.1) +0.0% (81.0 → 81.0) +2.2% (91.0 → 93.0)
png tileSize=1024 c=1 -0.7% (28.2 → 28.0) +0.0% (34.0 → 34.0) +6.5% (46.0 → 49.0)

@Kanahiro
Kanahiro merged commit d980563 into main Aug 18, 2026
10 checks passed
@Kanahiro
Kanahiro deleted the codex/fix-encoded-glyph-paths branch August 18, 2026 15:14
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.

s3:// glyphs fail when fontstack contains spaces (same as #223, fixed for file:// in #224)

1 participant