[core] reland #23405 (#23491)
Revert "[core] fix network inspector does not preview response body without content-length header (#23405)"This reverts commit 703fa4b5d5b671326f0846217b28b9e2858b71c7.
[core] fix network inspector does not preview response body without content-length header (#23405)# Why some responses do not have the `Content-Length` header, and we thought the content-lengt
[core] fix network inspector does not preview response body without content-length header (#23405)# Why some responses do not have the `Content-Length` header, and we thought the content-length is zero and not sent the `Network.receivedResponseBody` CDP event. fixes #23383 close ENG-9261 # How - sending the `Network.receivedResponseBody` even `Content-Length` is unknown. we only care about our `responseBody` exceeds our 1MB buffer or not. - moving `Network.loadingFinished` after `Network.receivedResponseBody`. that should be correct order - [ios only] the `encodedDataLength` should be real bytes transferred on the network without decoding. that pr fixes the semantic correctly. unfortunately, on android okhttp, they don't have an easy way to get the real bytes, so on android we still use the `Content-Length` and may sometimes get `encodedDataLength=-1` # Test Plan - test network inspector preview for `fetch("https://api.publicapis.org/entries")` - unit test passed
show more ...
[core] send CDP type by mime type (#23058)# Why previously we send the CDP request/response type as `fetch` always. we should send other types like `image` when the resources are images close E
[core] send CDP type by mime type (#23058)# Why previously we send the CDP request/response type as `fetch` always. we should send other types like `image` when the resources are images close ENG-8609 # How based on mime type to send the corresponding CDP type. for unknown data, we will send `other`. so we will never send `fetch` type anymore, because we cannot differentiate whether the requests are coming from fetch or other requests like image or native calls. # Test Plan - tested on bare-expo - added unit test
[core][dev-launcher] refactor network interceptor on ios (#22669)# Why since we are going to integrate the network interceptor into expo go, this pr tries to move some shared code into expo-modu
[core][dev-launcher] refactor network interceptor on ios (#22669)# Why since we are going to integrate the network interceptor into expo go, this pr tries to move some shared code into expo-modules-core, fixing some issues and adding unit tests. # How - move the interceptor protocol class and cdp logger into expo-modules-core - introduce strong typed `CdpNetworkTypes` - fix http redirection issues - fix duplicated CDP events when integrated with reanimated (we should exclude reanimated from the `sendWrappedEventToAllPages` # Test Plan - add `ExpoRequestCdpLoggerSpec` unit tests - ci passed - test network interceptor on bare-expo --------- Co-authored-by: Tomasz Sapeta <[email protected]>