Skip to content

Fixed issue: Persisted edge host value was not used for Target request issued upon app close & relaunch#119

Merged
swarna04 merged 2 commits intoadobe:dev-v3.2.0from
swarna04:MOB-17008
Jul 29, 2022
Merged

Fixed issue: Persisted edge host value was not used for Target request issued upon app close & relaunch#119
swarna04 merged 2 commits intoadobe:dev-v3.2.0from
swarna04:MOB-17008

Conversation

@swarna04
Copy link
Copy Markdown
Contributor

Description

Ref: [MOB-17008]

  • Previously persisted edge host should be used when a Target request is issued on app relaunch.
  • Fixed an incorrect test case
  • code cleanup

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.

@swarna04 swarna04 requested a review from sbenedicadb July 29, 2022 17:44
target = Target(runtime: mockRuntime)
target.onRegistered()
XCTAssertEqual("935CDD24-8FD7-4B30-8508-4BE40C3FC263", target.targetState.storedSessionId)
let sessionId = target.targetState.sessionId
Copy link
Copy Markdown
Contributor Author

@swarna04 swarna04 Jul 29, 2022

Choose a reason for hiding this comment

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

This call would generate a new session Id as session expired (see L258 where timestamp is set to a year back in setup) and update the session timestamp to current so when edge host is queried for the prefetch request, the new session wouldn't timeout and it would still be used. However, resetting the Edge host on launch when there is no prev stored configuration masked this.

if
let newClientCode = configuration[TargetConstants.Configuration.SharedState.Keys.TARGET_CLIENT_CODE] as? String,
newClientCode != clientCode
storedConfigurationSharedState != nil, newClientCode != clientCode
Copy link
Copy Markdown
Contributor Author

@swarna04 swarna04 Jul 29, 2022

Choose a reason for hiding this comment

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

storedConfigurationSharedState will be nil only on app relaunch. Subsequently it will be populated (see L131) and this check https://github.com/adobe/aepsdk-target-ios/blob/dev-v3.2.0/AEPTarget/Sources/Target.swift#L68 in readyForEvent will ensure it's present for subsequent requests.

@swarna04 swarna04 merged commit 9975a0a into adobe:dev-v3.2.0 Jul 29, 2022
swarna04 added a commit that referenced this pull request Jul 29, 2022
* Added support for Target session Id setter & getter (#115)

* Added support for Target session Id setter/ getter

* code cleanup

* Fixed formatting issue

* Incorporated feedback

* Incorporated feedback

* Added support for TntId setter API (#116)

* Added support for Target session Id setter/ getter

* code cleanup

* Fixed formatting issue

* Added support for Target tntId setter

* code cleanup

* fixed formatting

* fixed definition conflict test issue

* Incorporated feedback

* Incorporated feedback

* Using distinct Event name

* More testapp updates

* Release prep v3.2.0 (#117)

* release prep v3.2.0

* Feedback updates

* Dependency and doc updates

* Incorporated feedback

* Fixed issue: Persisted edge host value was not used for Target request issued upon app close & relaunch (#119)

* Fixed an issue where persisted edge host value was not used for Target request issued upon app close & relaunch

* minor doc update

* Target doc updates (#120)

* Target doc updates

* docs cleanup
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.

2 participants