Skip to content

fix: Fix ANRs, Refactor HealthData operations to use multiple dispatchers#458

Open
mirland wants to merge 1 commit into
carp-dk:mainfrom
xmartlabs:fix/anr-issue
Open

fix: Fix ANRs, Refactor HealthData operations to use multiple dispatchers#458
mirland wants to merge 1 commit into
carp-dk:mainfrom
xmartlabs:fix/anr-issue

Conversation

@mirland
Copy link
Copy Markdown

@mirland mirland commented Dec 9, 2025

This pull request updates the coroutine and threading model for Health Connect operations in the Android plugin, ensuring that all results sent to the Flutter layer are dispatched on the main thread using coroutines. It also improves concurrency in workout data aggregation by running multiple Health Connect queries in parallel.
These changes collectively make the plugin more robust, responsive, and maintainable.

@mirland
Copy link
Copy Markdown
Author

mirland commented Mar 27, 2026

Hi @iarata! Can you check this pr? Because it's fixing a critical issue in my side and it would be nice if I can integrate the package from the "original package" instead of my fork

ytsni added a commit to ytsni/health_bridge that referenced this pull request May 24, 2026
Cherry-picked and combined fixes from upstream PRs:

- carp-dk#484: Remove TOTAL_CALORIES_BURNED from iOS dataTypeKeys (SIGABRT crash)
- carp-dk#461: Make distance/energy/steps reads optional when fetching workouts
  (fixes silent empty list + Play Store permission rejection)
- carp-dk#458: Replace Handler(mainLooper) with coroutine dispatchers, parallelize
  workout metric queries (fixes ANRs)
- carp-dk#459: Add try/catch to Health Connect operations (rate limit crash fix)
- carp-dk#477: Add BIKING_STATIONARY mapping for Health Connect
- carp-dk#491: AGP 9.x compatibility (conditional kotlin-android plugin)
- carp-dk#492: Fix workoutSummary always null on Android (accept both camelCase
  and snake_case keys from native layer)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ytsni added a commit to ytsni/health_bridge that referenced this pull request May 24, 2026
Cherry-picked and combined fixes from upstream PRs:

- carp-dk#484: Remove TOTAL_CALORIES_BURNED from iOS dataTypeKeys (SIGABRT crash)
- carp-dk#461: Make distance/energy/steps reads optional when fetching workouts
  (fixes silent empty list + Play Store permission rejection)
- carp-dk#458: Replace Handler(mainLooper) with coroutine dispatchers, parallelize
  workout metric queries (fixes ANRs)
- carp-dk#459: Add try/catch to Health Connect operations (rate limit crash fix)
- carp-dk#477: Add BIKING_STATIONARY mapping for Health Connect
- carp-dk#491: AGP 9.x compatibility (conditional kotlin-android plugin)
- carp-dk#492: Fix workoutSummary always null on Android (accept both camelCase
  and snake_case keys from native layer)
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