-
Notifications
You must be signed in to change notification settings - Fork 64
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
RUM-6235 Handle sse request #2270
Conversation
...tions/dd-sdk-android-okhttp/src/main/kotlin/com/datadog/android/okhttp/DatadogInterceptor.kt
Outdated
Show resolved
Hide resolved
...tions/dd-sdk-android-okhttp/src/main/kotlin/com/datadog/android/okhttp/DatadogInterceptor.kt
Outdated
Show resolved
Hide resolved
...tions/dd-sdk-android-okhttp/src/main/kotlin/com/datadog/android/okhttp/DatadogInterceptor.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is one comment about arrayOf
-> setOf
(performance-wise on such small collection it won't matter though), otherwise lgtm
@@ -89,7 +89,8 @@ timber = "5.0.1" | |||
coroutines = "1.4.2" | |||
|
|||
# Local Server | |||
ktor = "1.6.0" | |||
ktor = "1.6.8" | |||
ktorServer = "3.0.0-rc-1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a concern if we are using a rc
here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This lib is only used for the sample app, so it's ok
b3aafcb
to
307372d
Compare
307372d
to
4fc8a54
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #2270 +/- ##
===========================================
+ Coverage 69.80% 69.90% +0.10%
===========================================
Files 731 731
Lines 27156 27160 +4
Branches 4572 4575 +3
===========================================
+ Hits 18954 18985 +31
+ Misses 6919 6901 -18
+ Partials 1283 1274 -9
|
What does this PR do?
This PR Handles properly SSE (Server Sent Event) network request instrumented with our OkHttp interceptor.
In order to report the size of a downloaded resource, we use the
peekBody()
method which tries to read the whole content of the network request. In case of a SSE request, it would wait until the end of the stream to eventually complete the interception and forward the content to the receiver, blocking the server messages.ServerSent events should have the
text/server-event
Mime Type, which we can use to detect such use case.Motivation
Fixes #2266