Set parent ID to Edge response events#69
Conversation
Codecov Report
@@ Coverage Diff @@
## dev-v2.1.0 #69 +/- ##
=============================================
Coverage ? 83.63%
Complexity ? 377
=============================================
Files ? 29
Lines ? 1570
Branches ? 223
=============================================
Hits ? 1313
Misses ? 160
Partials ? 97
Flags with carried forward coverage won't be shown. Click here to find out more. |
| Map<String, String> eventData = FunctionalTestUtils.flattenMap(resultEvents.get(0).getEventData()); | ||
|
|
||
| assertEquals(10, eventData.size()); | ||
| assertEquals(11, eventData.size()); |
There was a problem hiding this comment.
processResponseOnError attached the requestEventId even before, is this change for the requestId? I did not find it in the asserts below
There was a problem hiding this comment.
No, for generic errors the requestEventId was not attached to the dispatched response, only the request ID. I changed the flow so generic errors are passed through to dispatchEventErrors like other errors, so the requestEventId is now attached.
https://github.com/adobe/aepsdk-edge-android/pull/69/files#diff-6ef6a1ddfee2bea9afe631a1ecae39d502b48d873db1a4d84b7d918b20bf41f2R282
There was a problem hiding this comment.
looks like this line was just setting the requestId as you mentioned, eventDataResponse.put(EdgeConstants.EventDataKeys.EDGE_REQUEST_ID, requestId);
Sounds good, let's assert for requestId too if we are not doing already.
...e/src/androidTest/java/com/adobe/marketing/mobile/NetworkResponseHandlerFunctionalTests.java
Outdated
Show resolved
Hide resolved
code/edge/src/main/java/com/adobe/marketing/mobile/NetworkResponseHandler.java
Show resolved
Hide resolved
Set parent ID to Edge response events (#69)
Description
Set parent ID to response events dispatched from NetworkResponseHandler. Parent ID is taken from events in
sentEventsWaitingResponse, so if response request ID or event index does not match an Event in the list the dispatched event will have a null parentID.Response events for
Edge.getLocationHint()already contain the parent ID (via Event.Builder.inResponseToEvent() api), so no code changes needed. Added tests to verify parentId in location hint response.Updates Mobile Core dependency to 2.2.0, which adds support for chaining events.
Related Issue
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: