Repository navigation
Add test tools to make it easier to test Network/reauthentication logic - #8713
Conversation
SequentialQueue requests when reauthenticating.…etries. Handle reauthentication in Network.onResponse() undo changes comments Improve reauthentication logic. Make it work with sequential queue. revert network changes Rename TestToolMenu rename
df0c003 to
d999192
Compare
| function serverLoggingCallback(logger, params) { | ||
| const requestParams = params; | ||
| requestParams.shouldProcessImmediately = false; | ||
| requestParams.shouldRetry = false; |
There was a problem hiding this comment.
One weird side effect of trigger the option where all the requests should fail is that some iteration of a Log command is getting retried forever. I suspect it's something like:
- Log fails
- We run out of retries for a Log command
- We log that we ran out of retries and log again
- etc.
But not 100% sure and need to debug some more. I think Log is a "persistable" request (but isn't today) so once we have a backoff logic in place we can retry it forever - but at some rate of backoff. For now, we would be making many requests over and over again if we had a situation like "Auth down" so I am making Log not retryable.
There was a problem hiding this comment.
Yeah, I think we need more debugging to find out that
|
Still testing on some platforms but taking out of draft. |
| function serverLoggingCallback(logger, params) { | ||
| const requestParams = params; | ||
| requestParams.shouldProcessImmediately = false; | ||
| requestParams.shouldRetry = false; |
There was a problem hiding this comment.
Yeah, I think we need more debugging to find out that
|
all you @marcaaron |
| This enables QA and internal testers to take advantage of sandbox environments for 3rd party services like Plaid and Onfido. */} | ||
| <TestToolRow title="Use Secure Staging Server"> | ||
| <Switch | ||
| isOn={props.user.shouldUseSecureStaging} |
There was a problem hiding this comment.
When I tested locally, I got this console warning:
I think we can fix that by adding the default values to Onyx.init, no?
Lines 26 to 36 in 5b8b75c
There was a problem hiding this comment.
Oh hmm I guess if there is a user object then it won't use the defaults. Sorry @Justicea83 I am going to put the short circuit back in here. @marcochavezf not sure if this is something for initialKeyStates- the code was fine before so I'm going to revert that last change.
There was a problem hiding this comment.
Sure that's fine, we look good now!
marcochavezf
left a comment
There was a problem hiding this comment.
LGTM, this test tool is cool!
|
✋ 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 @marcochavezf in version: 1.1.57-0 🚀
|
|
🚀 Deployed to production by @chiragsalian in version: 1.1.57-17 🚀
|

cc @marcochavezf
Details
Test Tools
A few testing tools are being added here so we can test conditions
Fixed Issues
https://github.com/Expensify/Expensify/issues/207534
Tests
Note: for native platforms this diff needed to be applied to get "staging"
Authenticateappears in the Chrome Dev Tools network tab and you are reauthenticatedPR Review Checklist
PR Reviewer Checklist
### Fixed Issuessection aboveTestssectionQA stepssectiontoggleReportand notonIconClick).src/languages/*filesSTYLE.md) were followed/** comment above it */displayNamepropertythisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)Avataris modified, I verified thatAvataris working as expected in all cases)QA Steps
Authenticateappears in the Chrome Dev Tools network tab and you are reauthenticated (Web Only)Screenshots
Web
Mobile Web
Desktop
iOS
Android