Skip to content

Concierge identityMap passthrough - #168

Merged
rymorale merged 5 commits into
adobe:devfrom
BNanda99:feature/concierge-identitymap-passthrough
Sep 21, 2026
Merged

rymorale merged 5 commits into
adobe:devfrom
BNanda99:feature/concierge-identitymap-passthrough

Conversation

@BNanda99

Copy link
Copy Markdown
Member

Forwards the full Edge Identity identityMap to the Concierge conversation and feedback requests, instead of hardcoding an ECID-only block. Any additional identities an app has set via Identity.updateIdentities(_:) (AEPEdgeIdentity) — e.g. a lowercase hashedEmail, a CRMID, or any org-specific namespace — are now forwarded verbatim in xdm.identityMap, alongside ECID.

Description

  • Verbatim pass-through, no per-namespace logic. Whatever EdgeIdentity's shared state has under identityMap is serialized as-is. The SDK does not interpret, relabel, or filter namespaces.
  • ECID stays the readiness signal. ECID is still derived from identityMap.ECID[0].id and still gates chat/request creation — it's just a subset of the map now, not read independently.
  • No public API change. Concierge.show(...) is unchanged; identityMap is read from the same com.adobe.edge.identity XDM shared state the extension already depends on for ECID. Apps that never call Identity.updateIdentities(_:) see the same ECID-only behavior as before, with one additive, non-breaking wire delta: the ECID entry now also carries authenticatedState/primary (previously stripped to bare id).
  • Safe fallback. If the map is unavailable, identityMap in the request body serializes to an empty object ({}) rather than reconstructing an ECID-only map.
  • No PII in logs. Only namespace keys are logged when updating the Concierge configuration — never id values.

Changes:

  • ConciergeStateRepository — added identityMap to ConciergeState; renamed updateExperienceCloudId → updateIdentity, which stores the full EdgeIdentity identityMap verbatim and derives the ECID via a new extractEcid helper (logs namespace names only, never id values).
  • ConciergeConversationServiceClient — added identityMapJson, which serializes the identityMap via JSONObject (escapes arbitrary keys/values); replaced the hardcoded ECID-only block in both the conversation and feedback request bodies.
  • ConciergeExtension — identity shared-state handler now calls updateIdentity.
  • Tests — added coverage for full-map, ECID-only (no regression), empty-map, and auth-token coexistence cases across the repository, client, and extension test suites.
  • Documentation/implementation-guide.md — documented that the full identityMap is forwarded and how to send custom identities via Identity.updateIdentities(...).

Related Issue

Motivation and Context

Today the Concierge SDK sends only the ECID to the conversation and feedback endpoints, hardcoding "identityMap": { "ECID": [ { "id": "" } ] }. Customers need to forward additional identities they've already set on the device via Identity.updateIdentities(_:) so namespace priority/uniqueness (e.g. CRMID as primary) can be resolved server-side in AEP. The SDK was silently dropping that data; this change stops dropping it.

How Has This Been Tested?

  • Ran ./gradlew :concierge:testPhoneDebugUnitTest — full :concierge suite green (rebased on latest dev).

  • Added unit tests: full identityMap forwarded verbatim (ECID + hashedEmail + custom namespace), ECID-only baseline (no regression), absent map → empty {}, and identityMap + auth-token coexistence.

  • Verified both customer paths: ECID-only still forwards the ECID; a full identityMap forwards all namespaces.

Screenshots (if appropriate):

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.

Previously the SDK sent only the ECID to the conversation and feedback
endpoints, dropping any additional identities the customer set via
Identity.updateIdentities (e.g. hashedEmail, CRMID, custom namespaces).

Now the full EdgeIdentity identityMap is carried verbatim:
- ConciergeState stores the whole identityMap; ECID is derived from it
  and kept as the readiness signal (updateExperienceCloudId -> updateIdentity).
- The request/feedback bodies serialize the map via JSONObject (escaping
  arbitrary keys/values), replacing the hardcoded ECID-only block.
- Namespaces are forwarded as-is (no interpretation/relabeling); priority
  and identity-graph rules are configured server-side in AEP.
- Log namespace names only, never id values (PII).

Adds unit tests for the full-map, ECID-only (no regression), and empty-map
cases, plus auth-token coexistence, and documents the capability in the
implementation guide.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@codecov

codecov Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.11765% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...eting/mobile/concierge/ConciergeStateRepository.kt 91.66% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

Biswajit Nanda and others added 2 commits September 14, 2026 14:12
JSONObject.toString() returns null rather than throwing on an
unserializable map, so the previous runCatching/getOrElse fallback was
never exercised (and would have emitted "identityMap": null). Replace it
with an explicit null-coalescing fallback to an empty object, and add
tests for the serialization-failure and empty-identityMap branches.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The `clear resets state to initial values` test populated identityMap
but never verified it was nulled after clear(). Add the missing
assertion so a future selective-reset refactor that forgets identityMap
is caught directly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@BNanda99
BNanda99 marked this pull request as ready for review September 15, 2026 15:59

@rymorale rymorale left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@BNanda99
BNanda99 requested a review from josej-ea September 16, 2026 05:45

@prudrabhat prudrabhat left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
@BNanda99 - please verify the following on an emulator

  • logs with/without additional identities
  • valid responses streamed from concierge

@BNanda99

Copy link
Copy Markdown
Member Author

LGTM. @BNanda99 - please verify the following on an emulator

  • logs with/without additional identities
  • valid responses streamed from concierge

yes tested on emulator and the identityMap is passed with additional identities and only ECID is passed when no identity is passed. The concierge is providing valid responses

Biswajit Nanda and others added 2 commits September 16, 2026 22:15
The Identities section re-documented the Edge Identity updateIdentities
API, which belongs to the identity extension's docs. Replace the inline
sample with a link to the official Edge Identity API reference so there
is a single source of truth; keep only the Brand Concierge-specific
behavior (verbatim forwarding, ECID auto-included, server-side rules).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@rymorale
rymorale merged commit 4fa8cc9 into adobe:dev Sep 21, 2026
11 checks passed
rymorale added a commit to rymorale/aepsdk-concierge-android that referenced this pull request Sep 21, 2026
The upstream/dev merge (PR adobe#168) added full identityMap passthrough via
identityMapJson(), but only wired it into the feedback request body.
createXdmObject (used by chat and data-handoff requests) still built its
own bespoke ECID-only identityMap inline, so it never picked up the
passthrough behavior — breaking 4 ConciergeConversationServiceClientTest
cases after the merge.

createXdmObject now reuses identityMapJson(state), the same helper the
feedback path already relies on.
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