Skip to content

fix(headless): preserve local data in exports and sleep queries - #69

Merged
lingcang728 merged 1 commit into
lingcang728:mainfrom
1072302482:codex/headless-data-integrity
Sep 9, 2026
Merged

fix(headless): preserve local data in exports and sleep queries#69
lingcang728 merged 1 commit into
lingcang728:mainfrom
1072302482:codex/headless-data-integrity

Conversation

@1072302482

Copy link
Copy Markdown

This fixes #68: CLI GPX exports use the default summary payload, which omits the route, so a workout with recorded GPS is incorrectly reported as having no GPS data.

Additional, independently reproduced data omissions are included: the default type list contains daily, CSV consumes a summary payload, and several supported types never enter the corresponding core queries. This also fixes CSV device provenance, workout samples after local midnight, and weight records that contradict the workout scope's exclusion metadata.

  • Correct the default type name and reject invalid export arguments before opening the database or touching output; retain JSON usage errors and the existing exit-code contract.
  • Use full payloads for CSV/GPX/FIT while preserving JSON's summary default and CSV's column layout. Device values remain anonymized.
  • Complete the core's type-query guards and enforce the existing workout time/scope boundaries.
  • Load the full latest sleep detail for MCP, including its recorded stage timeline.

Regression tests exercise the shared export builder and real CLI subprocesses with synthetic SQLite libraries, including GPX/FIT output, unchanged source databases, unchanged existing output on usage errors, and complete/missing sleep stages.

No schema, dependency, normalizer, sync, desktop UI, or repository documentation changes.

Validation on Windows with Rust 1.98.1 and the existing lockfile:

  • cargo fmt --manifest-path src-tauri/Cargo.toml --all -- --check
  • cargo check --manifest-path src-tauri/Cargo.toml --workspace --locked --offline --all-targets
  • cargo clippy --manifest-path src-tauri/Cargo.toml --workspace --locked --offline --all-targets -- -D warnings
  • cargo test --manifest-path src-tauri/Cargo.toml --workspace --locked --offline: 383 passed, 0 failed; 1 existing real-old-database fixture test remains ignored.

GitHub CI, Linux/macOS execution, and the unchanged frontend build/tests have not been run locally.

Fixes #68.

@lingcang728
lingcang728 merged commit c988385 into lingcang728:main Sep 9, 2026
9 checks passed
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.

命令行 export --format gpx 恒失败:detail 默认 summary 会剥掉 route,错误信息却称活动没有 GPS

2 participants