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 Jul 29, 2022
Merged
Conversation
…t request issued upon app close & relaunch
swarna04
commented
Jul 29, 2022
| target = Target(runtime: mockRuntime) | ||
| target.onRegistered() | ||
| XCTAssertEqual("935CDD24-8FD7-4B30-8508-4BE40C3FC263", target.targetState.storedSessionId) | ||
| let sessionId = target.targetState.sessionId |
Contributor
Author
There was a problem hiding this comment.
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.
swarna04
commented
Jul 29, 2022
| if | ||
| let newClientCode = configuration[TargetConstants.Configuration.SharedState.Keys.TARGET_CLIENT_CODE] as? String, | ||
| newClientCode != clientCode | ||
| storedConfigurationSharedState != nil, newClientCode != clientCode |
Contributor
Author
There was a problem hiding this comment.
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.
sbenedicadb
approved these changes
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Ref: [MOB-17008]
Related Issue
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: