Closed AndyTWF closed 1 week ago
Status | Category | Percentage | Covered / Total |
---|---|---|---|
π’ | Lines | 92.63% (π― 92%) | 2728 / 2945 |
π’ | Statements | 92.63% (π― 92%) | 2728 / 2945 |
π’ | Functions | 92.57% (π― 92%) | 212 / 229 |
π’ | Branches | 94.02% (π― 93%) | 771 / 820 |
Context
N/A
Description
This change fixes the usePresence integration test. It was flaking because a leave and detach in quick succession (as the test does via unmounting) can lead to duplicate presence events as realtime will do an implicit leave for any detachments it deems still in presence.
This would lead to the presence events array having 4 events (instead of the expected 3).
The fix is to assert on seeing specific presence events we expect to see, showing that we get the desired behaviour, but without falling over because of potential race conditions.
It also fixes the messages.integration.test during the transitional period to using per-message serials.
Checklist
Testing Instructions (Optional)
Run the test with many repeats and observe the lack of flakeyness!