Skip to content

Identity refactor#191

Merged
addb merged 13 commits intoadobe:consentfrom
addb:identityRefactor
Sep 6, 2024
Merged

Identity refactor#191
addb merged 13 commits intoadobe:consentfrom
addb:identityRefactor

Conversation

@addb
Copy link
Copy Markdown
Contributor

@addb addb commented Aug 28, 2024

Description

Changes in Identity

  • Identity contains IdentityModule and IdentityState
  • IdentityState is updated by IdentityModule and contains value of ECID
  • Identity Module no longer fetches ECID independently, it queues the request with Edge Module
  • Identity module can set ECID based on Edge request response (state:store) or fetch ECID response(identity:result)
  • Identity will only query ECID if no ECID is present and customer calls getECID.
  • Identity will drop the ecid value from getECID if it get's ECID before that from consent or other edge request's response

Edge Changes

  • Edge no longer needs ECID from Identity module. If present it will use it, if not it will rely on first edge request whose response will contain ECID and will be extracted by Identity Module and persisted with IdentityState
  • EdgeRequestWorker - queue processing will halted if ECID is not present after sending the first request, so that the response from the request can populate the ECID and subsequent requests can have the ECID.

Integration Test Changes

  • Added some logic to testRunner to cleanup and allow common use cases like before each, before all, after all
  • Added test helpers
  • Edited and updated current Integration tests to align with all the code changes

Related Issue

Motivation and Context

How Has This Been Tested?

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.

@addb addb requested review from kevinlind and praveek August 28, 2024 21:14
@addb addb linked an issue Aug 28, 2024 that may be closed by this pull request
…y:result handle when Ecid is not cached with the SDK.
@addb addb requested a review from kevinlind September 3, 2024 23:48
m._edgeModule = _adb_EdgeModule(m._configurationModule, m._identityModule, m._consentState)
m._identityState = _adb_IdentityState()
m._edgeModule = _adb_EdgeModule(m._configurationModule, m._identityState, m._consentState)
m._identityModule = _adb_IdentityModule(m._identityState, m._edgeModule, m._task)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Instead of passing the task to the identity module, it would be cleaner to modify the getECID function to accept a callback. The function can then notify the task through the callback, so other modules don’t need to be aware of the task.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@praveek sounds good. Updated to callbacks!

Copy link
Copy Markdown
Contributor Author

@addb addb Sep 5, 2024

Choose a reason for hiding this comment

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

@praveek Also fixed issues like:

- All the waiting callbacks will be called
- Callback map will be cleared once all callbacks are processed

Changes:

- (IdentityModule) getECIDAsync to get the response in callbacks

@addb addb requested a review from praveek September 5, 2024 19:07
addb added 2 commits September 5, 2024 13:10
…sor to dispatch the event to task properly. Also need to publish sendEvent response to task since we support sendEventWithCallback.
Copy link
Copy Markdown

@kevinlind kevinlind left a comment

Choose a reason for hiding this comment

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

Looks good.

@addb addb requested review from praveek September 6, 2024 18:35
@addb addb merged commit e581b4c into adobe:consent Sep 6, 2024
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.

Queue Identity requests with the unified Edge queue

3 participants