Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set parent ID to Edge response events (resolves #327) #361

Merged
merged 4 commits into from
Jun 26, 2023

Conversation

kevinlind
Copy link
Collaborator

Description

Add event stitching (chaining) support by setting the Event.parentId to the Event.id of the triggering event.

  • Updates NetworkResponseHandler to save the list of awaiting Events, instead of just the Event IDs and timestamps. The Event is used to create a "chained" response event.
  • Network responses which either do not match the request Id or the eventIndex does not match an awaiting event, do not have a parent ID for the response events.
  • getLocationHint response events also have a parent ID, however the existing Event.createResponseEvent() API already sets the parent ID so no code changes were required. Test cases were added, however.

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 June 20, 2023 22:59
@kevinlind kevinlind linked an issue Jun 20, 2023 that may be closed by this pull request
@kevinlind kevinlind changed the title Chain parent ID to Edge response events Set parent ID to Edge response events (resolves #327) Jun 20, 2023
@codecov
Copy link

codecov bot commented Jun 20, 2023

Codecov Report

Merging #361 (9f4e6a5) into dev (1cf1b14) will increase coverage by 0.02%.
The diff coverage is 100.00%.

❗ Current head 9f4e6a5 differs from pull request most recent head 0aff7be. Consider uploading reports for the commit 0aff7be to get more accurate results

@@            Coverage Diff             @@
##              dev     #361      +/-   ##
==========================================
+ Coverage   96.68%   96.70%   +0.02%     
==========================================
  Files          27       27              
  Lines        1626     1634       +8     
==========================================
+ Hits         1572     1580       +8     
  Misses         54       54              

Copy link
Contributor

@emdobrin emdobrin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just some minor comments

if let requestParentEvent = requestParentEvent {

if let requestParentEvent = parentRequestEvent {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: parentRequestEvent

@kevinlind kevinlind merged commit e475087 into adobe:dev Jun 26, 2023
@kevinlind kevinlind deleted the event-stitching branch June 26, 2023 19:24
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.

Set the parentId in all responses
2 participants