Skip to content

Preserve metadata extensions when other metadata is empty - #296

Open
Bortlesboat wants to merge 1 commit into
tkrajina:devfrom
Bortlesboat:fix/preserve-metadata-extensions
Open

Bortlesboat wants to merge 1 commit into
tkrajina:devfrom
Bortlesboat:fix/preserve-metadata-extensions

Conversation

@Bortlesboat

Copy link
Copy Markdown

Summary

GPX 1.1 metadata extensions now survive serialization when no other metadata fields are set. This also prevents data loss when a caller removes the name from a parsed document before saving it.

Fixes #280.

Validation

  • python -m unittest test: all 147 tests pass on Python 3.13.12. The corrected round-trip test and both compact/pretty name-removal cases failed before the fix.
  • gpxinfo succeeds on all checked-in .gpx fixtures. Empty metadata remains omitted, and the existing GPX 1.0 extension-exclusion test passes.
  • Strict mypy reports the same 19 errors as base 35569eb. Flake8 on the two changed files adds no diagnostics compared with that base (1,568 versus 1,570).

Developed and reviewed with Codex assistance.

Post-Deploy Monitoring & Validation

For downstream adoption, verify that GPX 1.1 save/load preserves extension tags, attributes and text. Missing extensions or unexpected empty metadata are regression signals; retain the prior version if either occurs. The repository's CI matrix remains the upstream validation gate.


Compound Engineering

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.

to_xml removes metadata extensions without the name tag present

1 participant