Preserve metadata extensions when other metadata is empty - #296
Open
Bortlesboat wants to merge 1 commit into
Open
Bortlesboat wants to merge 1 commit into
Bortlesboat wants to merge 1 commit into
Conversation
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.
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.gpxinfosucceeds on all checked-in.gpxfixtures. Empty metadata remains omitted, and the existing GPX 1.0 extension-exclusion test passes.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.