-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
[HOLD for payment 2024-09-25] [$250] Contact Method - Magic code doesn't arrive unless user requests again #43359
Comments
Triggered auto assignment to @grgia ( |
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
|
@grgia FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors |
Job added to Upwork: https://www.upwork.com/jobs/~0107ec935581e086f0 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @allroundexperts ( |
Marking as external so we might get help from contributors sooner |
Proposal to Fix the Issue: "Contact Method - Magic Code Doesn't Arrive Unless User Requests Again" Problem Description: Steps to Reproduce:
Expected Result: Actual Result:The magic code is only sent after the user clicks "Didn't receive a magic code?". Technical Explanation and Proposed Solution:
I came across this project on Upwork and would like to offer the above solution. I have outlined a technical explanation to address this issue as mentioned. I can't wait to dive into this amazing project and see how I can help out with other tasks too. Looking forward to making a positive impact! |
📣 @TheGithubDev! 📣
|
Contributor details |
✅ Contributor details stored successfully. Thank you for contributing to Expensify! |
I wasn't able to reproduce this in staging. Adding a new contact method sent me the email. |
Gonna demote to NAB |
@lanitochka17 Is this still happening? Seems to be fixed for me as well. |
Issue is still reproducible 2024-06-12.20.19.10.mp4 |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
Issue is still reproducible on the latest build 9.0.23-0 bandicam.2024-08-21.11-37-00-930.1.mp4 |
Edited by proposal-police: This proposal was edited at 2023-10-02T14:22:00Z. ProposalPlease re-state the problem that we are trying to solve in this issue.Magic code will not be sent unless the user requests it again. What is the root cause of that problem?We are not sending any request code unless it's manually pressed What changes do you think we should make in order to solve the problem?Modify this useEffect to call src/pages/settings/Profile/Contacts/ContactMethodDetailsPage.tsx useEffect(() => {
if (isEmptyObject(loginData)) {
return;
}
User.resetContactMethodValidateCodeSentState(contactMethod);
// initialCodeValidateRequestedRef is required to prevent duplicate calls in React strict mode
if (!loginData?.validatedDate && !loginData?.validateCodeSent && !initialCodeValidateRequestedRef.current) {
User.requestContactMethodValidateCode(contactMethod);
initialCodeValidateRequestedRef.current = true;
return;
}
// eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps
}, []); To prevent the "linkHasBeenResent" text from appearing on the initial page load, we can add a new state called "validateCodeSentIsPressed" to display the message only after the resent link has been pressed at least once. src/pages/settings/Profile/Contacts/ValidateCodeForm/BaseValidateCodeForm.tsx <Text style={[StyleUtils.getDisabledLinkStyles(shouldDisableResendValidateCode)]}>{translate('validateCodeForm.magicCodeNotReceived')}</Text>
</PressableWithFeedback>
{hasMagicCodeBeenSent && validateCodeSentIsPressed && (
<DotIndicatorMessage
type="success"
style={[styles.mt6, styles.flex0]} What alternative solutions did you explore? (Optional)Alternative 1If we want to keep the user to trigger the validationCode manually, we can add new screen that contain the send validation button or at least change Alternative 2Call requestContactMethodValidateCode when we navigate to src/components/ValidateAccountMessage.tsx <TextLink
fontSize={variables.fontSizeLabel}
onPress={() => {
const loginName = loginNames?.[0]
const login = loginList?.[loginName] ?? {};
if (!login?.validatedDate && !login?.validateCodeSent) {
User.requestContactMethodValidateCode(loginName);
} src/pages/settings/Profile/Contacts/ContactMethodsPage.tsx <MenuItem
title={menuItemTitle}
description={description}
onPress={() => {
const login = loginList?.[loginName] ?? {};
if (!login?.validatedDate && !login?.validateCodeSent) {
User.requestContactMethodValidateCode(loginName);
} Ensure re-sent message only shown when pressed at least once const [validateCodeSentIsPressed, setValidateCodeSentIsPressed] = useState(false);
...
const resendValidateCode = () => {
User.requestContactMethodValidateCode(contactMethod);
inputValidateCodeRef.current?.clear();
setValidateCodeSentIsPressed(true);
};
...
{hasMagicCodeBeenSent && validateCodeSentIsPressed && (
<DotIndicatorMessage
type="success" |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
Triggered auto assignment to @mountiny, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
@allroundexperts @wildan-m Why can we not make the api request when user clicks the button that navigates them? it feels like a better spot for this api call than the useEffect. But both work |
📣 @wildan-m 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
@mountiny I think that's better approach. We don't need to handle useEffect strict mode with that approach. My proposal updated @allroundexperts I will create the PR with that solution. Let me know if we still want to use the useEffect approach. |
@allroundexperts The PR is ready for review. #48047 |
This issue has not been updated in over 15 days. @wildan-m, @allroundexperts, @mountiny, @grgia eroding to Monthly issue. P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do! |
$250 to @wildan-m and to @allroundexperts |
Triggered auto assignment to @greg-schroeder ( |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 1.4.81-1
Reproducible in staging?: Y
Reproducible in production?: N
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Email or phone of affected tester (no customers): berhanesarah.testing+ftu@gmail.com
Issue reported by: Applause - Internal Team
Action Performed:
Expected Result:
Magic code is sent to the email
Actual Result:
Magic code is not sent to the email unless the user clicks "Didn't receive a magic code?"
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6507792_1718011277868.2024-06-10_12_00_02.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @allroundexpertsThe text was updated successfully, but these errors were encountered: