Skip to content

Conversation

agilst
Copy link
Contributor

@agilst agilst commented Jul 28, 2025

IMPORTANT: It is mandatory to merge both #1193 and #1194 before merging this PR as it's depend on getHealthDataByUUID method in #1193 and #1194 PRs. merged.

writeHealthData and writeWorkoutData is now returns String? uuid using InsertRecordsResponse.recordIdsList.firstOrNull() on Android and HKObject.uuid.uuidString on iOS. Please note that there is no extra efforts added when writing health data.

This is useful for some apps that need to utilise uuid once successfully writing health data (e.g. store into database for future use).

@iarata iarata changed the base branch from master to health13/prs August 31, 2025 15:58
@iarata
Copy link
Contributor

iarata commented Aug 31, 2025

@agilst I'm thinking, the way this is implemented now might result in faster API rate limits on the device, since now you are doing WRITE & READ instead of just WRITE. Wouldn't it make more sense to generate the object before writing and then return it when writing is successful and null otherwise?

@agilst
Copy link
Contributor Author

agilst commented Sep 1, 2025

@iarata you're right. At this stage, I don't think generate the object before writing is a good idea as we already have getHealthDataByUUID. Probably only returns the health uuid or null is all we need then can freely decide to utilise getHealthDataByUUID if need the health object. I think that is the best way to keep the health object structure persistent.

I'll proceed with the changes if you agree. or let me know if you have another suggestion.

@agilst agilst changed the title Write data returns HealthDataPoint? object instead of boolean Write data returns String? uuid instead of boolean Sep 30, 2025
@agilst
Copy link
Contributor Author

agilst commented Oct 2, 2025

@iarata please kindly review or let me know if you have another suggestion.

@iarata
Copy link
Contributor

iarata commented Oct 14, 2025

@agilst Thanks for the PR!
We were in the process of moving the health package to its own repo and could you please send your PR to the https://github.com/carp-dk/carp-health-flutter?

@agilst
Copy link
Contributor Author

agilst commented Oct 15, 2025

Moved to carp-dk/carp-health-flutter#448.

@agilst agilst closed this Oct 15, 2025
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.

3 participants