RUM-6235 Handle sse request#2270
Merged
Merged
Conversation
0xnm
approved these changes
Sep 19, 2024
0xnm
reviewed
Sep 19, 2024
0xnm
approved these changes
Sep 19, 2024
0xnm
left a comment
Member
There was a problem hiding this comment.
there is one comment about arrayOf -> setOf (performance-wise on such small collection it won't matter though), otherwise lgtm
mariusc83
reviewed
Sep 19, 2024
| # Local Server | ||
| ktor = "1.6.0" | ||
| ktor = "1.6.8" | ||
| ktorServer = "3.0.0-rc-1" |
Member
There was a problem hiding this comment.
is there a concern if we are using a rc here ?
Contributor
Author
There was a problem hiding this comment.
This lib is only used for the sample app, so it's ok
xgouchet
force-pushed
the
xgouchet/RUM-6235/sse_request
branch
from
September 19, 2024 13:41
b3aafcb to
307372d
Compare
xgouchet
force-pushed
the
xgouchet/RUM-6235/sse_request
branch
from
September 19, 2024 13:51
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
|
mariusc83
approved these changes
Sep 19, 2024
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.
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-eventMime Type, which we can use to detect such use case.Motivation
Fixes #2266