Wait for the WebSocket disconnect before sending pushes in the push notification E2E tests - #6767
Conversation
…otification E2E tests
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
SDK Size Comparison 📏
|
|
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review. WalkthroughFour push-notification test flows now wait for the user’s WebSocket connection to close after the app goes to the background and before sending a notification. ChangesPush notification test synchronization
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~4 minutes Change: Other Suggested reviewers: Merge Risk: ⚪ Minimal · up to The added waits should reduce race-related push-test flakes. The external status contract is unavailable, but current evidence does not show that the synchronization is mis-scoped or identify a verified issue blocking merge. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. A rabbit checks the socket’s state Comment |
andremion
left a comment
There was a problem hiding this comment.
Looks good. Small thing on the description, not blocking: the push isn't dropped as a duplicate of the live event. ChatClient.handlePushMessage ignores it while the socket is connected (ignorePushMessageWhenUserOnline defaults to true for message.new). Happy to be told otherwise.



Goal
Fix the flaky push notification E2E tests. The push was sometimes sent before the app's WebSocket disconnected after going to background, so the SDK ignored it as the socket was connected.
Closes AND-1599
Implementation
BackendRobot.waitForWebSocketDisconnection()after everygoToBackground()inPushNotificationTests, asMessageListTestsalready does.Testing
The E2E run on this PR covers it.
🤖 Generated with Claude Code
Summary by CodeRabbit