Skip to content

entitlements: keep healthkit background-delivery on free teams - #491

Open
JlassiRafet wants to merge 1 commit into
xtool-org:mainfrom
JlassiRafet:fix/healthkit-background-delivery
Open

JlassiRafet wants to merge 1 commit into
xtool-org:mainfrom
JlassiRafet:fix/healthkit-background-delivery

Conversation

@JlassiRafet

@JlassiRafet JlassiRafet commented Dec 4, 2026 •

Copy link
Copy Markdown

What does this PR do?

On a free team, signing rebuilds the entitlements from the types xtool knows about, so com.apple.developer.healthkit.background-delivery was dropped and HKHealthStore.enableBackgroundDelivery failed on device.

This registers HealthKitBackgroundDeliveryEntitlement in supportedTypes. It has no DeveloperServicesCapability, so it is kept in the signed binary and never sent to the developer portal.

How was it tested?

  • Added HealthKitEntitlementTests (2 tests). The first applies the same filter as DeveloperServicesAddAppOperation to a plist with both HealthKit keys. It failed before the change (the key was dropped) and passes now. The second checks the new type has no capability.
  • Linux: swift test (63 passed), make lint (0 violations).
  • Not tested on macOS, and not on a device with a free team. I did not run xtool dev end to end.

AI tool usage

  • 0 - No AI was used to write code
  • 1 - I was assisted by AI in writing code. I reviewed the finished result.
  • 2 - I set the AI going and left it to it; nobody has read the result - no review, or AI review only

Refs #484

Summary by CodeRabbit

  • New Features
    • Added support for the HealthKit background delivery entitlement, including its Boolean value.
    • HealthKit entitlement values are preserved when applying the free-team entitlement filter.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The entitlement model now supports com.apple.developer.healthkit.background-delivery as a Boolean entitlement without an associated DeveloperServicesCapability. Tests check decoding and retention after free-team filtering.

Changes: HealthKit Background Delivery Entitlement

Layer / File(s) Summary
Register and test the entitlement
Sources/XKit/Model/Entitlements/EntitlementTypes.swift, Tests/XToolTests/HealthKitEntitlementTests.swift
Adds the entitlement type to the supported types. Tests check its decoded value, absence of a capability, and retention of both HealthKit keys after free-team filtering.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Possibly related issues

  • xtool-org/xtool issue 484: Describes free-team signing dropping the background-delivery key because it is not supported. This change adds that support and tests key retention; the issue’s device behavior was not validated in this PR.

Suggested reviewers: kabiroberai

Merge Risk: Minimal · up to 036e3

This change keeps the HealthKit background-delivery entitlement in signed apps for free teams. The change is small and tested, and no merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: HealthKit background-delivery entitlement is kept for free teams. The raw summary adds HealthKitBackgroundDeliveryEntitlement to supportedTypes, and the objectives say…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: HealthKit background-delivery entitlement is kept for free teams. The raw summary adds HealthKitBackgroundDeliveryEntitlement to supportedTypes, and the objectives say free-team signing previously dropped the key. The title is specific and matches the changeset.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b4618d83-b557-44fa-baa9-5ac23a8f2c82
Commits

Reviewing files that changed from the base of the PR and between a637309 and 036e351.

Files selected for processing: 2

  • Sources/XKit/Model/Entitlements/EntitlementTypes.swift
  • Tests/XToolTests/HealthKitEntitlementTests.swift

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

This branch has not been deployed

No deployments
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