-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only log network request when getWrappedStream is called (#787)
## Goal We were prematurely trying to log a span for a request sent using HttpUrlConnection - we used to overwrite this but since we don't do that anymore, it got used. Instead of relying on that, we streamline the logging - putting in the "cacheNetworkCall" to force request invocation down the path of calling getResponseCode(). This took care of some edge cases that we previously didn't cover. If we are not wrapping the stream, we log the call after the request is executed. If we are wrapping the stream, we do the logging when the stream is read and the bytes are counted. If there's an error during the execution or if the request wasn't executed at all because of the lack of a network connection, the logging happens at disconnect. HttpUrlConnection - you got me again! ## Testing Existing unit tests pass.
- Loading branch information
Showing
1 changed file
with
28 additions
and
27 deletions.
There are no files selected for viewing
This file contains 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