Create a Ping mechanism for Pusher#55326
Conversation
|
@abdulrahuman5196 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] |
|
|
||
| // Remove the event from the map | ||
| delete pingIDsAndTimestamps[pongEvent.pingID]; | ||
| Performance.markEnd(CONST.TIMING.PUSHER_PING_PONG); |
There was a problem hiding this comment.
@adamgrzybowski I wanted to CC you on this change to ensure I'm not missing anything with the performance tracking library. Happy to give you more context if you need it. I mostly just want to ensure I'm using this correctly and I'd like to build a Grafana chart for this.
cc @mountiny
There was a problem hiding this comment.
Also missed it the first time I read the comment 🤦 pinged Adam in Slack now
There was a problem hiding this comment.
Hey @tgolen, here's a breakdown:
Performancemodule is mostly used for local measurementsTimingmodule is reporting to external systems
If you want to send to Grafana, you can use the Timing module as per this example. Timing.start()/end() will ensure it's being sent.
I have plans for proposing a vision for these 2 going forward in a more unified way, but ^this is how they work now :)
There was a problem hiding this comment.
You can safely call one after the other
There was a problem hiding this comment.
Aha, perfect. I'll swap this out to use the timing module. Thanks!
There was a problem hiding this comment.
OK, I updated this and see it in the logs now:
Timing:development.new.expensify.pusher_ping_pong 949.5
|
This is off HOLD now since the API endpoint has been deployed to staging. @abdulrahuman5196 can you start reviewing it please? |
|
@abdulrahuman5196 Will you be able to review this one? what is your eta? |
|
Hi, @mountiny , I am having lesser availability this week. Could you re-apply the label for a different C+? |
I had considered doing some unit tests, but in the end, I decided against it. Since nearly everything would have to be mocked (the API requests and the PONG response from the server), all the unit tests would be doing is verifying that I'd be open to hearing any thoughts you have on providing a valuable unit test for this. |
|
OK, I've updated the branch to remove the submodules changes and to remove the unnecessary export. |
this makes sense i am with you here, think we can skip it 👍 |
|
i am completing the checklist video and testing on all platforms now 🙇 |
|
@tgolen sorry i didnt notice it before, can you please fix lint? |
|
Oh yeah, sorry. I missed that one. It's all fixed now |
|
ooof! 🫣 more lint and jest check failing @tgolen |
|
Yay, all 🟢 now! |
Co-authored-by: Vit Horacek <36083550+mountiny@users.noreply.github.com>
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/MariaHCD in version: 9.0.92-0 🚀
|
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.0.92-6 🚀
|
Explanation of Change
This PR will send a ping to the server every 30 seconds. The server has one minute to respond (an eternity really). If the client doesn't get a response, then the client will be put into offline mode.
Fixed Issues
$ #53826
Tests
api.phpto not ever send the pusher eventOffline tests
QA Steps
PINGPONGinto the filter bar at the top of the consolePR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop