Dispatch 'complete' event when streaming connection closed#83
Dispatch 'complete' event when streaming connection closed#83kevinlind merged 7 commits intoadobe:dev-v2.2.1from
Conversation
Codecov Report
@@ Coverage Diff @@
## dev-v2.2.1 #83 +/- ##
================================================
+ Coverage 83.63% 83.84% +0.21%
- Complexity 380 385 +5
================================================
Files 29 29
Lines 1582 1578 -4
Branches 225 223 -2
================================================
Hits 1323 1323
+ Misses 162 161 -1
+ Partials 97 94 -3
Flags with carried forward coverage won't be shown. Click here to find out more.
|
code/edge/src/main/java/com/adobe/marketing/mobile/NetworkResponseHandler.java
Show resolved
Hide resolved
code/edge/src/main/java/com/adobe/marketing/mobile/NetworkResponseHandler.java
Show resolved
Hide resolved
code/edge/src/main/java/com/adobe/marketing/mobile/NetworkResponseHandler.java
Show resolved
Hide resolved
timkimadobe
left a comment
There was a problem hiding this comment.
Looks great! Just had a question about the variable name for the new constants
code/edge/src/main/java/com/adobe/marketing/mobile/EdgeConstants.java
Outdated
Show resolved
Hide resolved
code/edge/src/test/java/com/adobe/marketing/mobile/NetworkResponseHandlerTest.java
Outdated
Show resolved
Hide resolved
code/edge/src/test/java/com/adobe/marketing/mobile/NetworkResponseHandlerTest.java
Outdated
Show resolved
Hide resolved
timkimadobe
left a comment
There was a problem hiding this comment.
Looks great! Thank you Kevin
Do we also want to include the new flag in the event reference documentation (https://github.com/adobe/aepsdk-edge-ios/pull/383/files#diff-49f4dd7f8fd0c3aa77b7402714be2b63f2a34fbfbace7def48fc4a6de450a344)? Or is there a better location for that one
I'm not sure on the best place to include it. I've updated the event-reference to include the sendCompletion plus to clarify the response content event. Let me know what you think. |
Documentation/event-reference.md
Outdated
| | Event type | Event source | | ||
| | ---------- | ------------ | | ||
| | com.adobe.eventType.edge | com.adobe.eventSource.responseContent | | ||
| | com.adobe.eventType.edge | defined by response handle type, or com.adobe.eventSource.responseContent | |
There was a problem hiding this comment.
small nit: what do you think of capital "Defined" instead of defined?
* Fix warnings in Gradle files (#80) * Fix deprecated use of * Fix Groovy warnings in build files * Dispatch 'complete' event when streaming connection closed (#83) * Send 'complete' event after all response handles are recieved when requested * Update event source variable names to match source name 'CONTENT_COMPLETE' * Reword method description for sendCompletionRequested * Add more tests to bump coverage numbers * Add Content Complete event to event-reference documentation * Update event-reference with sendCompletion property and response content definition. * Capitalize 'Defined' in table for completion event description * Bump version to 2.3.0 * Add content complete event to toc, update response content description * Revert 'asNode(null)' to 'asNode()'. Using 'asNode()' gives warning about implicit null value, however passing 'asNode(null)' fails to build publish step. * Replace hardcoded event source with EventSource.CONTENT_COMPLETE (#89) * Set Core dependency to 2.4.0 * Replace hardcoded event source with EventSource.CONTENT_COMPLETE * Fix failing deep copy test after Core changes to ignore invalid objects. * Initial setup of integration test class and dependencies * Enable passing test suite preset values via command line and IDE Update integration test setup steps * Add convenience method setExpectationForNetworkRequest that accepts a testable network request First integration test case * Add new test constants for edge integration testing, alphabetized * Add integration test cases and helpers * Update integration test core dependency version to 2.4.0 * Add more test cases * Apply lint formatting * Create helper resetTestExpectations() and update TestHelper.resetTestExpectations call * Remove unused methods * Refactor networkResponses to store list of all responses for given request Refactor usages Update documentation * Revert makefile changes for followup PR * Add back junit Assert import lost after merge resolution * Fix other merge issues * Rename setResponseConnectionFor to setResponseFor to match iOS naming --------- Co-authored-by: Kevin Lind <40409666+kevinlind@users.noreply.github.com> Co-authored-by: Kevin Lind <lind@adobe.com>
Description
Dispatch a "complete" event when the streaming connection is closed, when requested. This event may be used by extensions who are not using the public API
sendEventbut wish to know when all response handles are received for a given request event.Allows callers to add a flag to the Edge request to signal a "complete" event should be dispatched when the streaming connection is closed. The flag
sendCompletionis part of therequestobject, a sibling object to thedataandxdmobjects in the Edge Experience Event.The presence of the
sendCompletionflag in the request causes the Edge extension to dispatch a paired response event to signal to the caller that the connection is closed and no more streaming response handles will be dispatched. The response event is of typecom.adobe.eventType.edgeand sourcecom.adobe.eventSource.contentCompleteand contains data of justrequestIdfor debugging. TheparentIdof the event will match the UUID of the original request event.Related Issue
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: