Skip to content

Preserve FIT records on the equator and prime meridian - #3

Open
bensynapse wants to merge 1 commit into
a0ax:mainfrom
bensynapse:fix/fit-zero-axis-coordinates
Open

bensynapse wants to merge 1 commit into
a0ax:mainfrom
bensynapse:fix/fit-zero-axis-coordinates

Conversation

@bensynapse

Copy link
Copy Markdown

I run Live Tennis API.

FIT records with zero latitude or zero longitude are currently discarded, so a route crossing the equator or prime meridian loses those points. Accept zero in either known position field, then apply the existing coordinate-pair validation. The invalid sentinel, range checks, and rejection of (0, 0) are preserved. The parser's signature comparison also uses an equivalent byte string to satisfy strict Clippy.

Three regressions cover both axes in both hemispheres, full-file parsing, invalid sentinels, and the existing (0, 0) policy. All three fail before the fix. Validation on Rust 1.98.1/Linux:

  • cargo test --workspace: 124 tests pass; original suite: 121 pass.
  • cargo fmt --check and cargo clippy -- -D warnings: pass.
  • wasm-pack build --target web and the JavaScript package's npm run build: pass.
  • npm test -- --runInBand: 14 tests pass in the browser container with the pinned Chrome 121. Some Node cases use the harness's existing fallback, so I separately called the built ESM processGpxFiles with real WebAssembly on three FIT routes. The two zero-axis routes lose their middle point before the fix and retain it afterward; the positive-coordinate control works in both. Garmin's SDK decodes all three fixtures without errors.

The existing compiled CommonJS entry point still errors under Node 22 because its directory declares type: module; the compiled wrapper is byte-identical to upstream. The ESM path is verified. No generated bundles are included in this two-file change.

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