Get 'eventIndex' from 'report' object for interact response errors and warnings#72
Merged
kevinlind merged 3 commits intoadobe:dev-v2.2.0from Jul 14, 2023
Merged
Conversation
emdobrin
reviewed
Jul 11, 2023
| EdgeJson.Response.EventHandle.REPORT, | ||
| null | ||
| ); | ||
| int eventIndex = DataReader.optInt(report, EdgeJson.Response.EventHandle.EVENT_INDEX, 0); |
Contributor
There was a problem hiding this comment.
It is safe to pass in a null report map with the optTypedMap API - ref
And I like the swift implementation so much more 🙈
...e/src/androidTest/java/com/adobe/marketing/mobile/NetworkResponseHandlerFunctionalTests.java
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## dev-v2.2.0 #72 +/- ##
================================================
- Coverage 83.63% 83.63% -0.00%
- Complexity 377 380 +3
================================================
Files 29 29
Lines 1570 1582 +12
Branches 223 225 +2
================================================
+ Hits 1313 1323 +10
- Misses 160 162 +2
Partials 97 97
Flags with carried forward coverage won't be shown. Click here to find out more.
|
emdobrin
reviewed
Jul 13, 2023
code/edge/src/main/java/com/adobe/marketing/mobile/NetworkResponseHandler.java
Outdated
Show resolved
Hide resolved
emdobrin
approved these changes
Jul 14, 2023
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
Network responses for interact requests set the 'eventIndex' field under the 'report' object for errors and warnings and not the root error/warning object where Edge is currently looking. This change updates the NetworkResponseHandler to look under the "report" object for the "eventIndex" for errors and warnings. A successful response handle sets the "eventIndex" under the root handle object, so no change to that logic was made.
Below is an example of an interact network response, showing the location of the "eventIndex" in each of the 'handle', 'error', and 'warning' response objects.
Related Issue
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: