Skip to content

Activity sync improvements, bug fixes, auth token reuse, and tests#8

Open
jtpatters wants to merge 8 commits into
bes-dev:masterfrom
jtpatters:master
Open

Activity sync improvements, bug fixes, auth token reuse, and tests#8
jtpatters wants to merge 8 commits into
bes-dev:masterfrom
jtpatters:master

Conversation

@jtpatters
Copy link
Copy Markdown

  1. Improved Activity Synchronization:

    • The ActivitiesIterator now explicitly fetches activities in ascending order (sort_order='asc') and get_activities_for_date has been updated to handle that order, ensuring a mismatch and failure to write activities does not happen.
    • The sync_status for ACTIVITIES is now correctly updated to completed in _sync_activities_for_date, preventing the re-syncing of already processed activities.
  2. Bug Fixes:

    • Timezone-Aware Timestamps: The timestamp_to_datetime utility now returns timezone-aware datetime objects (UTC), ensuring consistency across the library.
    • Data Extraction: The _extract_steps_data method now correctly extracts steps from the last day in daily_steps, and extract_timeseries_data includes a None check for heart_rate.
  3. Enhanced Authentication Flow:

    • The SyncManager and garmy-sync CLI now attempt to initialize with saved authentication tokens before prompting for credentials, improving the user experience for repeated syncs (inspired by other outstanding PRs).
  4. Testing:

    • A new test file, tests/test_localdb_db.py, has been added with a test suite for the HealthDB class.
    • A test case has been added to verify that the ACTIVITIES sync status is correctly updated.
    • Existing tests have been updated to reflect the changes in the codebase.
  5. Build System:

    • The build system has been updated from setuptools to hatchling in pyproject.toml.

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