Skip to content

Get 'eventIndex' from 'report' object for interact response errors and warnings#363

Merged
kevinlind merged 2 commits intoadobe:devfrom
kevinlind:eventindex
Jul 14, 2023
Merged

Get 'eventIndex' from 'report' object for interact response errors and warnings#363
kevinlind merged 2 commits intoadobe:devfrom
kevinlind:eventindex

Conversation

@kevinlind
Copy link
Copy Markdown
Contributor

@kevinlind kevinlind commented Jul 11, 2023

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 moves the 'eventIndex' field from EdgeEventError to EdgeErrorReport and from EdgeEventWarning to EdgeEventWarningReport objects. A successful response handle sets the "eventIndex" under the root of EdgeEventHandle, 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.

{
  "requestId": "72eaa048-207e-4dde-bf16-0cb2b21336d5",
  "handle": [
    {
      "eventIndex": 0,
      "type": "state:store",
      "payload": [ ... ]
    }
  ],
  "errors": [
    {
      "type": "https://ns.adobe.com/aep/errors/EXEG-0201-503",
      "status": 503,
      "title": "The 'com.adobe.experience.platform.ode' service is temporarily unable to serve this request. Please try again later.",
      "report": {
           "eventIndex": 0
       }
    }
  ],
  "warnings": [
    {
      "type": "https://ns.adobe.com/aep/errors/EXEG-0204-200",
      "status": 200,
      "title": "A warning occurred while calling the 'com.adobe.audiencemanager' service for this request.",
      "report": {
        "eventIndex": 0,
        "cause": {
          "message": "Cannot read related customer for device id: ...",
          "code": 202
        }
      }
    }
  ]
}

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.

@kevinlind kevinlind requested review from addb and emdobrin July 11, 2023 03:09
@kevinlind kevinlind linked an issue Jul 11, 2023 that may be closed by this pull request
3 tasks
@codecov
Copy link
Copy Markdown

codecov bot commented Jul 11, 2023

Codecov Report

Merging #363 (07c6d13) into dev (e475087) will increase coverage by 0.04%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##              dev     #363      +/-   ##
==========================================
+ Coverage   96.70%   96.73%   +0.04%     
==========================================
  Files          27       27              
  Lines        1634     1653      +19     
==========================================
+ Hits         1580     1599      +19     
  Misses         54       54              

@emdobrin
Copy link
Copy Markdown
Contributor

emdobrin commented Jul 11, 2023

Based on this description I think we should also add integration tests that verify the expected format for each with the real endpoint, as well as asserting no unexpected keys are added in the handle body. We can take this in a separate PR as is depends on the integration tests feature branch. cc @timkimadobe

@kevinlind kevinlind merged commit b2eabc0 into adobe:dev Jul 14, 2023
@kevinlind kevinlind deleted the eventindex branch July 14, 2023 00:22
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.

Move eventIndex in interact response to event error/warning report object

2 participants