Skip to content

Commit

Permalink
[dev-launcher] fix network inspector CDP events missing occasionally (e…
Browse files Browse the repository at this point in the history
…xpo#23122)

# Why

fix the issue that devtools does not receive cdp events from dev-client sometimes.

# How

this issue happen when the dev server port listening on port other than 8081. the swizzled `connect` method will be called for EXDevMenu.bundle and EXDevLauncher.bundle. react-native will convert the address to port 8081. we should exclude the dev-client's bundle loading.

# Test Plan

- ci passed
- `npx expo start -p 8082` with network inspector test
  • Loading branch information
Kudo authored Jun 27, 2023
1 parent 79294b5 commit b067ef4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/expo-dev-launcher/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

### 🐛 Bug fixes

- [iOS] Fixed network inspector losing events when the dev-server listening on port other than 8081. ([#23122](https://github.com/expo/expo/pull/23122) by [@kudo](https://github.com/kudo))

### 💡 Others

## 2.4.3 — 2023-06-27
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ extension RCTInspectorDevServerHelper {
A0: bundleURL
) as? RCTInspectorPackagerConnection

DevLauncherNetworkInterceptor.inspectorPackagerConn = inspectorPackagerConn
// Exclude the connections for dev-client bundles
if !bundleURL.absoluteString.starts(with: Bundle.main.bundleURL.absoluteString) {
DevLauncherNetworkInterceptor.inspectorPackagerConn = inspectorPackagerConn
}
return inspectorPackagerConn
}
}
Expand Down

0 comments on commit b067ef4

Please sign in to comment.