-
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
[HOLD for payment 2023-08-16] [$1000] Web - Task - Error is shown as soon as app is put in background when creating a task #23552
Comments
Triggered auto assignment to @NicMendonca ( |
Bug0 Triage Checklist (Main S/O)
|
Not sure if this is an expected behavior. |
ProposalPlease re-state the problem that we are trying to solve in this issue.Assign task - Error is shown on blur What is the root cause of that problem?We validate the fields by default as you can see below Lines 301 to 304 in 4af18f6
This is the root cause What changes do you think we should make in order to solve the problem?I suggest to add the props called What alternative solutions did you explore? (Optional) |
ProposalPlease re-state the problem that we are trying to solve in this issue.Error is shown as soon as app is put in background when creating a task. What is the root cause of that problem?Lines 300 to 317 in 1205a74
In the above code, the When the app goes from the background to the foreground the This is the root cause of this problem. What changes do you think we should make in order to solve the problem?One approach to do this is to introduce a state that tracks whether the form has been submitted or not. Validation will only run when the form has been submitted. Here’s how we could modify the NewTaskDetailsPage.js: function NewTaskPage(props) {
const inputRef = useRef();
const [taskTitle, setTaskTitle] = useState(props.task.title);
const [taskDescription, setTaskDescription] = useState(props.task.description || '');
+ const [isSubmitted, setIsSubmitted] = useState(false); // Add this line to track form submission
useEffect(() => {
setTaskTitle(props.task.title);
setTaskDescription(props.task.description || '');
}, [props.task]);
function validate(values) {
const errors = {};
+ if (!values.taskTitle && isSubmitted) { // Add isSubmitted condition here
ErrorUtils.addErrorMessage(errors, 'taskTitle', 'newTaskPage.pleaseEnterTaskName');
}
return errors;
}
function onSubmit(values) {
+ setIsSubmitted(true); // Set isSubmitted to true when form is submitted
Task.setDetailsValue(values.taskTitle, values.taskDescription);
Navigation.navigate(ROUTES.NEW_TASK);
}
// ... rest of your code
} What alternative solutions did you explore? (Optional)None |
@thienlnam is this expected behaviour? |
Not really a big problem, but I guess worth fixing |
Job added to Upwork: https://www.upwork.com/jobs/~014f687ec29289cd8a |
Current assignee @NicMendonca is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @eVoloshchak ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Error message appear in the task title field once app is brought back to foreground What is the root cause of that problem?That's because when the input in the form is blurred, in here Line 297 in 4af18f6
When the app is put in background, it also blurs the input and trigger the validation, causing a janky experience. What changes do you think we should make in order to solve the problem?We need to trigger the validation We can wrap the
This is the same approach we're using to decide whether to show notification to the user in here What alternative solutions did you explore? (Optional)NA |
@eVoloshchak bump on reviewing this ^^ proposal |
@s-alves10 and @alphaboss1104's propose to validate the form on submit only, but I think we should retain the current behavior (and that would also mean the form behaves differently on different pages, which isn't ideal) @tienifr,'s proposal looks good to me, that is the correct approach I think
🎀👀🎀 C+ reviewed! |
Current assignee @thienlnam is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new. |
@eVoloshchak Could you please remember to link the appropriate proposals in the reviewed message? Thank you in advance! Agree with your analysis |
📣 @eVoloshchak Please request via NewDot manual requests for the Reviewer role ($1000) |
📣 @tienifr 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
On a side note: I don't consider the applied solution a perfect solution for the following reasons:
|
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.51-2 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2023-08-16. 🎊 After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
For reference, here are some details about the assignees on this issue:
As a reminder, here are the bonuses/penalties that should be applied for any External issue:
|
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
|
I'm so sorry for the delay in payment here. I don't know why this didn't change to daily for me 😓 |
@tienifr you've been paid |
@eVoloshchak please don't forget to request payment via Expensify and fill out the BZ check list |
|
@parasharrajat, ultimately we only have two options
However, I could only find one occurrence of this (validation is applied on blur) in |
|
Regression Test Proposal
Do we agree 👍 or 👎 |
@eVoloshchak I don't know if we should further pursue this problem. @thienlnam Do you think we should fix this #23552 (comment)? Technically, it is part of the problem. |
Sure, let's address that as well My preference is just that we update those locations to use the Form component |
Reviewed the details for @eVoloshchak. $1,000 approved for payment via NewDot based on BZ summary. |
@eVoloshchak thank you! |
all set here! |
@NicMendonca There are pending changes here. ref: #23552 (comment) #23552 (comment) |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
Expected Result:
No error message in the title field to appear since user have not clicked on next/continue button yet
Actual Result:
Error message appear in the task title field once app is brought back to foreground
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.45-1
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
Bug6140912_Screen_Recording_2023-07-25_at_1.45.31_PM.mp4
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: