Skip to content

Version Packages - #378

Merged
robertherber merged 1 commit into
masterfrom
changeset-release/master
Sep 7, 2026
Merged

Version Packages#378
robertherber merged 1 commit into
masterfrom
changeset-release/master

Conversation

@github-actions

@github-actions github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to master, this PR will be updated.

Releases

@kingstinct/react-native-healthkit@15.0.0

Major Changes

  • d279bc7: Fix unbounded memory growth when querying large numbers of samples or statistics (There seems to be a memory leak in this package #274), and improve memory management for workout proxies (getWorkoutRoutes() leaks memory across repeated calls, eventually hitting iOS's per-process memory limit #370).

    Breaking changes

    source values embedded in returned data are now plain { name, bundleIdentifier } objects instead of SourceProxy HybridObjects:

    • sample.sourceRevision.source on every sample type (quantity, category, workout, correlation, ECG, heartbeat series, medication, state of mind)
    • QueryStatisticsResponse.sources and QueryStatisticsResponseFromSingleSource.source

    Reading .name and .bundleIdentifier works as before. What no longer works on these values: toJSON() (they already are plain JSON), equals(), dispose(), and passing them into filter.sources. To filter by a sample's source, look the source up through querySources() by bundleIdentifier:

    const sources = await querySources('HKQuantityTypeIdentifierHeartRate')
    const source = sources.find(
      (candidate) => candidate.bundleIdentifier === sample.sourceRevision.source.bundleIdentifier,
    )
    await queryQuantitySamples('HKQuantityTypeIdentifierHeartRate', {
      filter: { sources: source ? [source] : [] },
    })

    querySources(), currentAppSource() and filter.sources keep using SourceProxy.

    Memory improvements

    • Every serialized sample and every statistics bucket used to allocate a native HybridObject just to carry the source's two strings. react-native-nitro-modules keeps a small bookkeeping record per HybridObject for the lifetime of the JS runtime, so memory grew with every query and never came back. Measured on the There seems to be a memory leak in this package #274 access pattern (200 workouts + 10,000 heart-rate samples per fetch, 120 fetches): growth dropped from about 147 MB to about 19 MB.
    • WorkoutProxy and SourceProxy now report an estimated native memory size to the JS engine, so the garbage collector accounts for the HKWorkout / HKSource graphs they keep alive and collects stale proxies sooner.
    • Errors while reading workout route locations are now propagated to the returned promise instead of crashing the app via try!.
    • New README section on memory considerations, including when to call dispose().

Patch Changes

  • b24b8ed: iOS: read isProtectedDataAvailable on the main actor in isProtectedDataAvailableAsync (UIApplication is @MainActor-isolated), and retry a statistics query once when HealthKit refuses with errorDatabaseInaccessible while protected data is available — the store re-opens a moment after the device unlocks, and a query issued in that window was surfacing as an opaque Code=6 string.

@github-actions
github-actions Bot force-pushed the changeset-release/master branch from 84d9936 to a36c9db Compare September 7, 2026 17:54
@pkg-pr-new

pkg-pr-new Bot commented Sep 7, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/kingstinct/react-native-healthkit/@kingstinct/react-native-healthkit@378

commit: a36c9db

@robertherber
robertherber merged commit b78bdb3 into master Sep 7, 2026
9 checks passed
@robertherber
robertherber deleted the changeset-release/master branch September 7, 2026 18:57
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