Skip to content

Conversation

@krystophv
Copy link
Member

@krystophv krystophv commented Nov 12, 2025

Prefers latest pump-related data over raw uploads when selecting the active pump upload Restricts attached pump settings to matching upload and time to prevent cross-dataset contamination Adds coverage to ensure fallback behavior and metadata normalization remain consistent

Partnered with export PR: tidepool-org/export#72 for BACK-3250

Relates to WEB-3916

Prefers latest pump-related data over raw uploads when selecting the active pump upload
Restricts attached pump settings to matching upload and time to prevent cross-dataset contamination
Adds coverage to ensure fallback behavior and metadata normalization remain consistent

Relates to WEB-3916
Copilot AI review requested due to automatic review settings November 12, 2025 21:21
Copilot finished reviewing on behalf of krystophv November 12, 2025 21:25
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR aligns the latest pump upload selection logic with actual pump data, prioritizing pump-related datums (basal/bolus) over raw upload records when determining the active pump. It restricts pump settings to match both the selected upload and time constraints to prevent cross-dataset contamination.

Key Changes:

  • New pump data-driven upload selection logic that examines basal and bolus datums to identify the most relevant upload
  • Time-constrained pump settings filtering to ensure settings don't exceed the latest pump data timestamp
  • Enhanced test coverage for dataset isolation, fallback scenarios, and metadata normalization

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/utils/DataUtil.js Implements pump data-driven upload selection and time-constrained settings filtering in setLatestPumpUpload() method
test/utils/DataUtil.test.js Adds comprehensive test cases for cross-dataset contamination prevention, time-based filtering, uploadId matching, and fallback behavior; updates metadata assertions to validate full settings objects

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants