-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Store User_IsFromPublicDomain in Onyx #3460
Conversation
Web-E PR is merged, so this can be tested locally using Web-E master. Should still be on hold until our next web deploy though, because it will fail staging QA until https://github.com/Expensify/Web-Expensify/pull/31169 is deployed to production. |
https://github.com/Expensify/Web-Expensify/pull/31169 was deployed to staging, not on prod yet |
cc @TomatoToaster I saw you HELD https://github.com/Expensify/Expensify/issues/166039 on this ... feel free to follow along here and review if you want |
Onyx.merge(ONYXKEYS.USER, {isFromPublicDomain}); | ||
} else { | ||
// eslint-disable-next-line max-len | ||
console.debug(`Command User_IsFromPublicDomain returned error code: ${response.jsonCode}. Most likely, this means that the domain ${Str.extractEmail(sessionEmail)} is not in the bedrock cache. Retrying in ${RETRY_TIMEOUT / 1000 / 60} minutes`); |
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.
Not E.cash knowledgable, so not a blocker, is there a reason why we do console.debug()
in e.cash comparing to our Web code.
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.
Well we can use this library for server logs. Those should show up in LogSearch I believe. I just didn't think we needed this in server logs, but we could put them there. What do you think?
But if you're asking why we used console.debug
instead of console.log
, it's mostly because we have some ESLint rule that bans console.log
. I'm honestly not too sure why.
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.
I don't know honestly, we don't usually log errors in the console and just keep them in the server, that's why I am asking. But maybe since now the repo is public, this makes easier for contributors to debug, no idea haha
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.
Well if this happens, we'll likely have server logs for the ClearbitCheckPublicEmail
bedrock job that was just created, so let's just leave this for now. I think it'll maybe be useful for debugging, esp. since it's not obvious why this request might fail.
No longer on hold! |
✋ 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 in version: 1.0.68-5🚀
|
🚀 Deployed to production in version: 1.0.73-3🚀
|
Details
This is a weird API that relies on Bedrock cache. If there is no domain info in the bedrock cache, we create a separate bedrock job to get the domain info from clearbit. In this case, the
User.getPublicDomainInfo
Onyx action will auto-retry itself after 10 minutes.Fixed Issues
Fixes (partial) https://github.com/Expensify/Expensify/issues/120480
Tests / QA Steps (Web/Desktop)
roryabrahamtest@gmail.com
Application
->Local Storage
. Look for a key "user", and verify that it contains the dataisFromPublicDomain: true
.rory@expensify.com
Application
->Local Storage
. Look for a key "user", and verify that it contains the dataisFromPublicDomain: false
.On dev only
Verify that your dev console shows debug-level logs
Create and validate a new account with a private domain name, such as
rory@mynewdomain.com
Login to E.cash with the new account.
Check the local storage – there should be no value
isFromPublicDomain
under theuser
key.There should also be a debug-level console log saying:
Go into the bedrock sql database, and check for a bedrock job:
Run
bwm.sh
After 10 minutes has passed, check the local storage again. Verify that the value
isFromPublicDomain: false
is set under theuser
key.Tests / QA (iOS/Android/mWeb)
QA is dependent on easy access to JS console, so just regular regression testing - no extra QA.
Tested On
Screenshots
Web
Desktop