Skip to content

Feature - Add consent independent device attributes api - #155

Merged
akhiljain1907 merged 15 commits into
dev-v5.2.0from
feature/device-attributes-review-fixes
Oct 21, 2026
Merged

akhiljain1907 merged 15 commits into
dev-v5.2.0from
feature/device-attributes-review-fixes

Conversation

@akhiljain1907

@akhiljain1907 akhiljain1907 commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Description

Adds Identity.updateOperationalData(_:). It sends operational data, such as the timezone, push token and Live Activity push-to-start tokens, to the Edge Network whatever the collect consent. Only values allowed by a Tags rule are sent, and only when they changed. Behavior matches Edge Identity Android (adobe/aepsdk-edgeidentity-android#155).

Public API

  • Swift: Identity.updateOperationalData(_ attributes: [String: Any])
  • Objective-C: [AEPMobileEdgeIdentity updateOperationalData:] (NSDictionary<NSString *, id> *)
  • An empty map is ignored. Values are not validated and are sent as given.

Flow

  1. The API dispatches edgeIdentity / com.adobe.eventSource.requestOperationalData. Edge Identity matches the event on type and source, not name.
  2. Edge Identity forwards the data to the rules engine as com.adobe.eventType.generic.operationalData / requestContent.
  3. A rule with the forward-operational-data consequence (AEPCore 5.13.0) returns only the allowed paths as edgeIdentity / com.adobe.eventSource.responseOperationalData. If no rule matches, nothing is sent and no result event is dispatched.
  4. Edge Identity removes unchanged values, adds app { id: <bundle id>, platform: apns | apnsSandbox } (from messaging.useSandbox), and dispatches com.adobe.eventType.edgeDeviceAttributes / requestContent. The Edge extension sends this to the device attributes endpoint.
  5. One request is in flight at a time. The next one is sent when the Edge response (edgeDeviceAttributes / responseContent) for the active request arrives, whatever its status.

Deduplication (edgeidentity.optimizeOperationalProfileDataSync, default true)

  • Only timezone, tokens.pushNotification and tokens.liveActivityStart are deduplicated and stored. Push-to-start tokens are compared ignoring order. All other values, including tokens.liveActivityUpdate, are always sent and never stored.
  • A value is skipped when it matches the value Edge last confirmed, whatever the collect consent.
  • When collect consent is y, or the Consent extension is not registered, a value is also skipped when it matches what its owner already holds: the timezone set through MobileCore.updateProfileAttributes, or Messaging's push token and push-to-start tokens. That value is stored as confirmed.
  • Confirmed values are stored in the com.adobe.mobilecore.operationalData collection. They are cleared by resetIdentities. Push-to-start tokens are also cleared when Messaging clears Live Activities.

Events and shared state

  • Each request ends with one Operational Data Sync Result event (edgeIdentity / responseContent) containing {status, reason, attributes}.
    • reason is "" on success.
    • When nothing is sent to Edge, reason is unchanged, identityReset or missingAppIdentifier.
    • Otherwise, on failure, it is Edge's reason, or unknown.
  • On success, if tokens were sent, an Operational data confirmed event (messaging / responseContent, {tokens}) is dispatched for Messaging.
  • A confirmed timezone also updates the profile attributes timezone.
  • Confirmed values, merged with the profile timezone, are published in the standard shared state under profileAttributes. At registration this is published only when something is stored.

Changes to existing behavior

  • Profile attributes (updateProfileAttributes, released in 5.1.0): an XDM shared state is created only when the timezone actually changes. Previously, every profile attributes event resolved a pending XDM shared state. The XDM com.adobe.mobilecore.profileAttributes.timeZone content is unchanged.
  • AEPCore dependency raised to >= 5.13.0 in AEPEdgeIdentity.podspec and Package.swift. Podfile.lock updated to Core 5.13.0 and AEPIdentity 5.13.0 (test dependency).
  • Version is 5.2.0 (base dev-v5.2.0).

Dependencies for release

  • Requires an Edge extension that handles com.adobe.eventType.edgeDeviceAttributes (Isolated consent-independent device-attributes endpoint path to Edge Network aepsdk-edge-ios#547). Edge Identity cannot declare Edge as a dependency, because Edge already depends on Edge Identity. With an older Edge, the request gets no response, and later requests wait behind it.
  • Release order: AEPCore 5.13.0 (released), then this release, then Edge with #547, with its AEPEdgeIdentity dependency raised to this version.
  • Messaging must match the Operational data confirmed event by type, source and tokens, not by event name.

Related Issue

MOB-25063. Supersedes #149 and #154. Android: adobe/aepsdk-edgeidentity-android#155. Edge: adobe/aepsdk-edge-ios#547.

Motivation and Context

The timezone, push token and Live Activity push-to-start tokens are operational data that must reach the profile even without collect consent. The existing profile and Messaging paths are consent-gated. This API sends these values through Edge's dedicated device attributes endpoint, but only the values a Tags rule allows. It does not resend values that have not changed, and it reports every outcome so callers and Messaging can react.

How Has This Been Tested?

New tests:

  • IdentityOperationalDataTests (93): routing, app, deduplication and the config flag, owner comparison at every consent state, the queue and response matching, result and confirmed events, reset, shared state and Live Activity clear.
  • OperationalDataDeduplicatorTests (16).
  • Two tests in IdentityPublicAPITests. IdentityTimezoneTests and IdentityTests are updated for the profile attributes shared-state change.

Local runs on Xcode 26.3, iPhone 16 simulator (iOS 18.4):

  • xcodebuild test -workspace AEPEdgeIdentity.xcworkspace -scheme UnitTests: passed, 149/149, at 9400880. The code is identical to 65094c6 apart from the 5.2.0 version bump.
  • xcodebuild test -workspace AEPEdgeIdentity.xcworkspace -scheme FunctionalTests: passed, 144/144, at 9400880.
  • make lint: passed, no violations, at 9400880.
  • xcodebuild test ... -only-testing:FunctionalTests/EdgeIdentityAndIdentityDirectTests: passed, 8/8, at 65094c6.
  • Temporary, not committed, run at 65094c6:
    • Objective-C caller .m in UnitTests: passed, 4/4. The generated header declares + (void)updateOperationalData:(NSDictionary<NSString *, id> * _Nonnull)attributes;.
    • Scenarios through AEPCore 5.13.0's real LaunchRulesEngine with a forward-operational-data rule: passed, 23/23. They cover all, push-only, timezone-only and no attributes enabled, no matching rule, consent y/n/pending, the timezone set through both paths, push token owner match, sandbox platform, failure retry, reset and restart.

Also verified with a temporary harness: Edge Identity together with Messaging (feat/live-activity-consent-independent-forward) and the Consent extension, using real EventHub and Core 5.13.0, with Edge's device attributes response simulated. Consent transitions caused no extra device attributes requests for synced values.

CI: the first run on 65094c6 failed once in EdgeIdentityAndIdentityDirectTests.testEcidsAreDifferentAfterReset, which is unrelated and passes locally. A re-run is in progress.

Screenshots (if appropriate):

N/A

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@akhiljain1907 akhiljain1907 changed the title Feature - Add consent independent device attributes api (Reference PR - https://github.com/adobe/aepsdk-edgeidentity-ios/pull/154) Feature - Add consent independent device attributes api Oct 18, 2026
@akhiljain1907
akhiljain1907 changed the base branch from main to dev-v5.2.0 October 21, 2026 11:32
akhiljain1907 and others added 15 commits October 21, 2026 17:06
Introduce updateDeviceAttributesBypassConsent(_:), a new public API that
lets apps sync device attributes (timezone, push token) to Edge without
being gated by collect consent. It dispatches an operational-data event
that a Launch rule forwards to Edge's device-attributes endpoint, keeping
this data off the normal consent-gated interact path.

Key pieces:
- DeviceAttributes struct as the input, so new attributes can be added
  later without changing the API signature (Swift-only; a struct param
  can't be bridged to @objc).
- Generalize ProfileAttributeHandler into AttributeHandler with an
  injected store name and a dedup flag, and rename the file accordingly.
- Give the profile and device paths separate dedup stores so identical
  values on one path never suppress the other. Sharing a store would let
  a profile update silently swallow the device dispatch (data loss), so
  the two store names must stay distinct.
- Make device-path dedup configurable via edgeidentity.deviceAttributes.dedup
  (defaults to true).
- Derive the APNs platform from messaging.useSandbox, since the aps
  environment isn't reliably readable at runtime.

The device path deliberately publishes no XDM shared state: nothing reads
it, and putting device attributes there risks leaking them onto the
consent-gated path.

Adds unit and functional coverage for routing, dedup on/off, store
isolation, the profile-vs-device clash, and app-context handling.
…en map instead of fixed DeviceAttributes structure
…from rules engine and also update success in store based on successful edge response.
- Use the nested synced store with deep-merge commits and order-insensitive array comparison
- Dedup against the synced store first, and against owner values only when collect consent is y; treat an unregistered Consent extension as y
- Copy values that match an owner into the synced store
- Release the active request on any matching Edge result, matched by parentID or requestEventId
- Publish the Device Attributes Sync Result event from Edge Identity on success and on failure
- Publish profileAttributes in the standard shared state and keep XDM as released
- Rename the dedup config key to edgeidentity.optimizeOperationalProfileDataSync
- Clear Live Activity tokens when Messaging clears Live Activities
- Run DeviceAttributeDeduplicatorTests in the UnitTests target
@akhiljain1907
akhiljain1907 force-pushed the feature/device-attributes-review-fixes branch from 9400880 to 65094c6 Compare October 21, 2026 11:36
@akhiljain1907
akhiljain1907 merged commit 9b3608f into dev-v5.2.0 Oct 21, 2026
46 of 50 checks passed
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