Fixed processing order for update/ get events in the extension#82
Fixed processing order for update/ get events in the extension#82swarna04 merged 3 commits intoadobe:dev-v4.0.2from
Conversation
sbenedicadb
left a comment
There was a problem hiding this comment.
looks good - couple of small nits
| ``` | ||
| dependencies: [ | ||
| .package(url: "https://github.com/adobe/aepsdk-optimize-ios.git", .upToNextMajor(from: "4.0.0")) | ||
| .package(url: "https://github.com/adobe/aepsdk-optimize-ios.git", .upToNextMajor(from: "4.0.2")) |
There was a problem hiding this comment.
i guess they're synonymous, but the change is fine :)
There was a problem hiding this comment.
Yup, just making sure the value here reflects the latest version!
| eventsQueue.setHandler { event -> Bool in | ||
| if event.isGetEvent { | ||
| self.processGetPropositions(event: event) | ||
| } else if event.type == EventType.edge { |
There was a problem hiding this comment.
use your extension?
} else if event.isUpdateEvent {
There was a problem hiding this comment.
Nope, we are tracking the edge-request content dispatched to edge extension (as a result of update propositions API call). The content complete response event will contain the edge event's ID for parent ID.
| .compactMap { $0.name } | ||
|
|
||
| if targetDecisionScopes.isEmpty { | ||
| guard !validDecisionScopes.isEmpty else { |
Sources/AEPOptimize/Optimize.swift
Outdated
| // In AEP Response Event handle, `requestEventId` corresponds to the UUID for the Edge request. | ||
| // Storing the request event UUID to compare and process only the anticipated response in the extension. | ||
| updateRequestEventIdsInProgress[edgeEvent.id.uuidString] = validDecisionScopes | ||
|
|
||
| // add the Edge event to update propositions in the events queue. | ||
| eventsQueue.add(edgeEvent) |
There was a problem hiding this comment.
makes more sense to the reader to move these above the MobileCore.dispatch call i think.
particularly, i notice manipulating the updateRequestEventIdsInProgress dictionary in the callback, but we hadn't seen any entry made to that dictionary at that point.
There was a problem hiding this comment.
Yeah, can move those above for clarity purposes, however I believe these will almost always be executed before the async callback is invoked.
* Fixed processing order for update/ get events in the extension (#82) * Fix events processing order in the extension. * Added/ updated tests * Incorporated feedback * More tests for events ordering + minor fixes (#83) * More tests + minor fixes * feedback update * Reset in-progress propositions in unexpected scenarios (#85) * More tests + minor fixes * feedback update * Reset in-progress propositions if request eventId is no longer being tracked. * more fixes
* Fixed processing order for update/ get events in the extension (#82) * Fix events processing order in the extension. * Added/ updated tests * Incorporated feedback * More tests for events ordering + minor fixes (#83) * More tests + minor fixes * feedback update * Reset in-progress propositions in unexpected scenarios (#85) * More tests + minor fixes * feedback update * Reset in-progress propositions if request eventId is no longer being tracked. * more fixes
Description
Ref: [MOB-19606]
Related Issue
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: