-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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] |
src/libs/actions/User.ts
Outdated
|
||
// Remove the event from the map | ||
delete pingIDsAndTimestamps[pongEvent.pingID]; | ||
Performance.markEnd(CONST.TIMING.PUSHER_PING_PONG); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@adhorodyski Wrong Adam @tgolen
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also missed it the first time I read the comment 🤦 pinged Adam in Slack now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @tgolen, here's a breakdown:
Performance
module is mostly used for local measurementsTiming
module 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can safely call one after the other
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aha, perfect. I'll swap this out to use the timing module. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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+? |
src/libs/PusherUtils.ts
Outdated
} | ||
|
||
export default { | ||
getUserChannelName, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NAB, its not imported anywhere else, why do we export it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah, I was using this somewhere else eary on in the development of this PR, but then I went a different direction and didn't remove this. I'll clean it up.
Mobile-Expensify
Outdated
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
@tgolen do we need unit tests for this ?
|
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! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One NAB, looks good to me @MariaHCD do you want to review?
Co-authored-by: Vit Horacek <[email protected]>
✋ 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.php
to not ever send the pusher eventOffline tests
QA Steps
PINGPONG
into the filter bar at the top of the consolePR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop