You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to request the implementation of change token support to facilitate efficient and reliable data synchronization.
Change tokens are a robust mechanism for incrementally fetching changes (insertions, updates, and deletions) since the last sync. This would be an incredibly valuable feature for applications that need to interact with large datasets while maintaining synchronization efficiently.
Use Case
Currently, the library requires developers to rely on timestamp-based filtering to fetch new or updated records. While this approach works for basic use cases, it has several limitations:
Handling Deletions: Timestamp-based filtering does not track deletions, requiring additional logic or full dataset comparisons to reconcile data.
Backdated Data: Records added or updated with backdated timestamps may be missed during synchronization.
Efficiency: Fetching data based on timestamps can be less efficient, especially when dealing with large datasets and complex queries.
By supporting change tokens, the library could provide:
Incremental data synchronization for all types of changes (insertions, updates, and deletions).
Improved performance by reducing redundant data fetching.
Enhanced reliability in syncing data states accurately.
Proposed Solution
Implement support for the Health Connect change tokens feature in the react-native-health-connect library. Specifically:
Provide a method (e.g., getChanges) that accepts a ChangeToken and returns the incremental changes since the last sync, along with a new ChangeToken.
Include information about:
Inserted records
Updated records
Deleted records
API Example
const { changes, nextChangeToken } = await getChanges({
recordType: 'Steps', // Specify the record type
changeToken: previousChangeToken, // Use the last saved change token
});
// Process changes
changes.forEach(change => {
if (change.changeType === 'INSERT') {
// Handle new records
} else if (change.changeType === 'UPDATE') {
// Handle updated records
} else if (change.changeType === 'DELETE') {
// Handle deleted records
}
});
// Save the new change token for the next sync
previousChangeToken = nextChangeToken;
Thank you for considering this feature request! This addition would greatly enhance the library's capabilities and make it easier for developers to build performant and reliable health-related applications.
The text was updated successfully, but these errors were encountered:
Description
I would like to request the implementation of change token support to facilitate efficient and reliable data synchronization.
Change tokens are a robust mechanism for incrementally fetching changes (insertions, updates, and deletions) since the last sync. This would be an incredibly valuable feature for applications that need to interact with large datasets while maintaining synchronization efficiently.
Use Case
Currently, the library requires developers to rely on timestamp-based filtering to fetch new or updated records. While this approach works for basic use cases, it has several limitations:
By supporting change tokens, the library could provide:
Proposed Solution
Implement support for the Health Connect change tokens feature in the react-native-health-connect library. Specifically:
Provide a method (e.g., getChanges) that accepts a ChangeToken and returns the incremental changes since the last sync, along with a new ChangeToken.
Include information about:
API Example
Thank you for considering this feature request! This addition would greatly enhance the library's capabilities and make it easier for developers to build performant and reliable health-related applications.
The text was updated successfully, but these errors were encountered: