-
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
Send platform info when making api requests #15973
Conversation
I marked this PR and other related PRs ready for review. But I cannot still confirm automatic sms validation behavior on the emulator (the magic code is not automatically extracted and passed to the input field). Please share ideas how we can test on a real device or or what might be the reason for the behavior not being observed on the Web-E PR. |
@PauloGasparSv 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] |
@PauloGasparSv 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] |
Please hold reviews now. I'll implement the change suggested here. |
ready for review now |
Reviewer Checklist
Screenshots/Videos |
Hey @hayata-suenaga I think we need to update the test steps right? Maybe we can do the following for testing:
I'll do that here but if those don't match the final test steps I'll re-test here : ) |
@PauloGasparSv thank you for suggesting test steps 🙇🏻♂️. These steps look good to me. I just added a few details on sending Also I updated some old comments in the initial comment. |
Hey @hayata-suenaga I forgot to mention: I think we may also have to change the Internal QA Steps as people won't be able to add that Log in prod and staging! |
@PauloGasparSv thank you for pointing that out. I'm actually not sure on which stage internal QAs are performed. If internal QA tests are needed, can people pull staging and production branches? |
I don't think so @hayata-suenaga! I think both QA stages (staging and prod) are done without having the source code or running anything locally but instead it's all done either direcly in https://staging.new.expensify.com/ or https://new.expensify.com/ or the Staging/Prod builds for Desktop, Android and iOS! BTW, here is an example of how QA is done in staging: https://github.com/Expensify/Expensify/issues/268894 IMO sometimes it's a bit hard to come up with valid QA steps because we can't do certain things in staging or prod that we can locally (a good example is creating and validating a VBA, that's pretty easy in dev but requires some extra steps in staging/prod) |
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.
LGTM!
@hayata-suenaga just saw the extra QA line you added! I still think those steps may not be possible to follow during QA.
If we log the platform in logSearch
the QA steps can be to Sign In and search for the platform
in logSearch
(but I'm not sure if we log that).
But I think it could also be:
-
Have QA steps for Web for checking if the
platform
was sent in the request (e.g.BeginSignIn
) by analyzing the request in the Network Tab of the Chrome Dev Tools. -
For all the remaining platforms, simply test if you can sign-in correctly and open a chat. That will trigger many requests that send the
platform
field and we'll make sure nothing is broken.
@PauloGasparSv thank you for the info on internal QA. I checked this SO. So internal QA checklists are automatically created when the PR with the label |
I made a staging section in QA testing steps in the original comment. |
@PauloGasparSv I just realized the production NewDot might be already sending platform info. I'll double check on this. Please don't merge this PR. I'll mark this PR as draft. |
I realized that the platform parameter is already being sent from NewDot to the backend. This PR is not necessary. I'm closing this now. |
Context
Master tracking issue here. This PR is one of three PRs necessary to send a hash along with a validation SMS message to Android device for auto-fill of magic code upon user sign in.
Deployment schedule
App, Auth (this PR) -> Web-E
This PR can be deployed independent of other PRs.
Details
We only need to add a hash when the user is trying to sign in from an android device. To determine what device the user is using on the server side, we need to pass platform information along with the request.
Fixed Issues
$ GH_LINK #15342
Tests
Internal QA
Development
api.php
and add the following line somewhere in the beginning of the file (maybe line 35):The WAF rule is already set for

platform
parameter in the current Web-E code. So you can test with the main code.2. Open a chat in NewDot
3. Open your terminal and start tailing logs with
../script/tail.sh "Platform:"
4. Sign into a NewDot (we want to send the
BeginSignIn
command as this is the command on which the new parameter is added). If you're already sign in, log out to sign in from the beginning.5. Make sure you see a log for the Platform and it matches the platform you tested
6. Make sure that you remove the log statement you added on step 1.
Staging
api?command=BeginSignIn
network request and click itpayload
tab to check theForm Data
sectionplatform
name (the value should be set toweb
)We want to check that the new parameter is sent in the request payload correctly. Although the purpose of the new parameter is to figure out if requests are coming from android, the existence of the
platform
payload confirms that the new parameter is at least sent without problem.The ideal QA test is to check this on an Android native app, but since a web browser is more easy to test, I used a web in the above testing steps
Offline tests
N/A
QA Steps
N/A
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)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
N/A