Repository navigation
chore: update NWWebSocket to 0.5.10 - #98052
Conversation
|
|
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@abzokhattab Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
JmillsExpensify
left a comment
There was a problem hiding this comment.
No product review required.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 638a34f715
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
🚧 mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
|
the HybridApp iOS fails to compile as shown in the adhoc build #98052 (comment) |
|
@MelvinBot review the PR |
PR ReviewThe App-side diff looks correct, but both HybridApp adhoc builds are red, and neither failure is fixable from this PR — both live in the paired Mobile-Expensify PR Expensify/Mobile-Expensify#14048 and need to be resolved there before this can merge. 🔴 iOS HybridApp —
|
|
@TMisiukiewicz conflicts here |
|
can we retrigger the adhoc @mountiny |
|
🚧 mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
|
iOS is still broken on both PRs |
dec0dfd to
2517850
Compare
We ship NWWebSocket 0.5.7 with two bugs, both fixed upstream, and both matching what our iOS clients do in production: - A reconnect that can never succeed - pusher/NWWebSocket#59, in 0.5.8. - Dead sockets that report themselves .ready - pusher/NWWebSocket#62, fixed in pusher/NWWebSocket#64, in 0.5.10. PusherSwift 10.1.6 already asks for NWWebSocket '~> 0.5.7', so only Podfile.lock was holding us at 0.5.7. Pinning the floor in the Podfile picks both fixes up with no other movement. 0.5.7..0.5.10 touches one file and changes no public API, so PusherSwift 10.1.6 links against it unchanged. OldDot shares this pod via PusherSwiftWithEncryption, so it gets both fixes too. Android is untouched. Where it hits us. 1d query on start=2026-08-09T00:00:00Z end=2026-08-10T00:00:00Z, deduplicated on (email, client timestamp): DISCONNECTED -> RECONNECTING 142,924 / 21,793 users = 6.56 100% iOS RECONNECTING -> DISCONNECTED 88,464 / 20,409 users = 4.34 100% iOS CONNECTING -> DISCONNECTED 75,672 / 19,881 users = 3.81 100% iOS RECONNECTING -> CONNECTED 25,708 / 11,327 users = 2.27 90.4% iOS Socket presumed dead (iOS) 48,954 / 21,811 users = 2.24 Only 18.0% of retries reach CONNECTED - 4.6 failures per success - and 60.6% of active iOS users entered the loop that day. Expect ReconnectApp to rise, not fall: a failed retry never re-subscribes, so fixing the loop converts 88,464 silent failures into successful connects. Why not bump @pusher/pusher-websocket-react-native to 1.3.5, which was the previous approach here. The wrapper's 1.3.1..1.3.3 diff contains no source files at all, only a podspec re-pin, and PusherSwift 10.1.6..10.1.10 changes no socket code either - both fixes are in NWWebSocket and nowhere else. What the bump does add is PusherSwift 10.1.9's swap of TweetNacl for PusherTweetNacl, a fork of the same C library. PusherSwiftWithEncryption was never published past 10.1.6, so OldDot stays on TweetNacl and both forks collide in the HybridApp binary. Dropped for a pin that carries the fixes and builds. Also fixes a dead branch in our own error plumbing. Native passed {data: {message}} with no `type`, while PusherConnectionManager gates its error handler on `'type' in error`, so every native Pusher error was dropped before any log call - 0 of 63,271 error lines carried a native user agent. Routing them through WEB_SOCKET_ERROR makes the reconnect cause attributable, which is what lets this change be measured rather than assumed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2517850 to
25bc816
Compare
Only conflict was the Mobile-Expensify submodule pointer. Resolved to our submodule merge commit, which contains main's pointer 95c3dcdc5d7. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Running new builds @abzokhattab in case you could test if they succeed please @adhorodyski can you remove the mobile-expensify dif? |
|
🚧 mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
# Conflicts: # Mobile-Expensify
|
reviewing now |
|
facing build errors on ios ... updating the device and retrying today ... however the changes look good to me |
The wrapper passes a code as the second onError argument, and both native
sides send one: iOS an Int, Android a String. We dropped it, so every
native socket error logged with no clue why the socket died.
Coerce with `Number(code) || undefined` because Android sends "" when it
has no code, and a bare Number("") would log a code of 0.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppOnly applicable for ios Android: mWeb ChromeOnly applicable for ios iOS: HybridAppUntitled.movScreen.Recording.2026-08-18.at.13.58.17.moviOS: mWeb SafariOnly applicable for ios MacOS: Chrome / SafariOnly applicable for ios |
abzokhattab
left a comment
There was a problem hiding this comment.
LGTM ... finally the local build worked .. had to update the device, xcode and the emulators to the latest versions
mountiny
left a comment
There was a problem hiding this comment.
Great find, thanks for testing @abzokhattab
|
🚧 mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.4.56-0 🚀
|
|
🤖 No help site changes required — I did not create a draft docs PR. This PR pins
The PR body itself states there is no UI change and no user-facing behaviour change ("Not applicable — no user-facing behaviour change"). The help site under If you believe a specific user-facing behavior does change (e.g. reconnection messaging that's documented somewhere), point me at the article and I'll take another look. |
|
Deploy Blocker #98942 was identified to be related to this PR. |
|
False alert the issue is not related |
|
sorry for false alarm @abzokhattab |
|
🚀 Deployed to production by https://github.com/Beamanator in version: 9.4.56-3 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
We ship
NWWebSocket 0.5.7with two bugs in it, both fixed upstream. They match what our iOS clients do in production..ready— NWWebSocket#62, fixed in #64 (0.5.10).Pinning
NWWebSocketto0.5.10lands both.PusherSwift 10.1.6already declaresNWWebSocket (~> 0.5.7), so onlyPodfile.lockheld us at0.5.7and no other pod moves.PusherSwiftWithEncryption 10.1.6shares the pod, so OldDot gets them too without a bump. Android is untouched.Where it hits us. 1d query on
start=2026-08-09T00:00:00Z end=2026-08-10T00:00:00Z, deduplicated on(email, client timestamp):DISCONNECTED -> RECONNECTINGRECONNECTING -> DISCONNECTEDCONNECTING -> DISCONNECTEDRECONNECTING -> CONNECTEDOnly 18.0% of retries reach
CONNECTED— 4.6 failures per success — and 60.6% of active iOS users entered the loop that day, with zero Android lines on the first three transitions.Expect
ReconnectAppto rise, not fall: a failed retry never re-subscribes, so fixing the loop converts 88,464 silent failures into successful connects.Fixed Issues
$ #98054
PROPOSAL:
MOBILE-EXPENSIFY: https://github.com/Expensify/Mobile-Expensify/pull/14048
Tests
iOS only — nothing here changes Android or web.
Offline tests
Not applicable — no user-facing behaviour change.
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
Same as Tests. No UI change.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
No UI change.
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari