Skip to content
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-06] [$250] There is no selected background after selecting Submission frequency as monthly #47574

Closed
1 of 6 tasks
m-natarajan opened this issue Aug 16, 2024 · 33 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2

Comments

@m-natarajan
Copy link

m-natarajan commented Aug 16, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 9.0.21-0
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
Expensify/Expensify Issue URL:
Issue reported by: @ZhenjaHorbach
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1723812299682989

Action Performed:

  1. Open account settings
  2. Open workspaces and choose any workspace
  3. In more features turn on Workflows and open it
  4. Turn on Delay submissions and open Submission frequency
  5. Choose monthly

Expected Result:

There should be selected background

Actual Result:

Notice that there is a check mark next to monthly, but there is no selected background

Workaround:

unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

2024-08-16.14.43.26.mov
Recording.2024.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01010057c5f8be0ff8
  • Upwork Job ID: 1824501452626526630
  • Last Price Increase: 2024-08-16
  • Automatic offers:
    • ZhenjaHorbach | Reviewer | 103626776
    • Krishna2323 | Contributor | 103626778
Issue OwnerCurrent Issue Owner: @
@m-natarajan m-natarajan added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Aug 16, 2024
Copy link

melvin-bot bot commented Aug 16, 2024

Triggered auto assignment to @puneetlath (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@ZhenjaHorbach
Copy link
Contributor

@puneetlath
I reported this issue
Can I be a reviewer here please?

@Krishna2323
Copy link
Contributor

Krishna2323 commented Aug 16, 2024

Edited by proposal-police: This proposal was edited at 2024-08-20 21:37:23 UTC.

Proposal

Please re-state the problem that we are trying to solve in this issue.

There is no selected background after selecting Submission frequency as monthly

What is the root cause of that problem?

  • shouldUpdateFocusedIndex isn't passed to SelectionList.
    <SelectionList
    ListItem={RadioListItem}
    sections={[{data: autoReportingFrequencyItems}]}
    onSelectRow={onSelectAutoReportingFrequency}
    initiallyFocusedOptionKey={autoReportingFrequency}
    />
  • The second visual glitch mentioned here occurs because the footer content is rendered before the option is marked as selected. This happens because we update the isMonthlyFrequency state to true as soon as an option is selected. However, the option is only marked as selected when frequencyKey === autoReportingFrequency, and autoReportingFrequency is derived from the Onyx state.

isSelected: frequencyKey === autoReportingFrequency,
footerContent: isMonthlyFrequency && frequencyKey === CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MONTHLY ? monthlyFrequencyDetails() : null,

if (item.keyForList === CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MONTHLY) {
setIsMonthlyFrequency(true);
return;
}

What changes do you think we should make in order to solve the problem?

  • We should pass shouldUpdateFocusedIndex to update the focused index on every selection change.
  • For the second bug we can remove the local state isMonthlyFrequency and use the frequencyKey === autoReportingFrequency check directly.

What alternative solutions did you explore? (Optional)

Result for the visual glitch mention here

Before

freq_before.mp4

After

freq_after.mp4

@cretadn22
Copy link
Contributor

cretadn22 commented Aug 16, 2024

Edited by proposal-police: This proposal was edited at 2024-08-16 16:18:58 UTC.

Proposal

Please re-state the problem that we are trying to solve in this issue.

There is no selected background after selecting Submission frequency as monthly

What is the root cause of that problem?

<SelectionList
ListItem={RadioListItem}
sections={[{data: autoReportingFrequencyItems}]}
onSelectRow={onSelectAutoReportingFrequency}
initiallyFocusedOptionKey={autoReportingFrequency}
/>

We don't pass shouldUpdateFocusedIndex, shouldSingleExecuteRowSelect props

What changes do you think we should make in order to solve the problem?

For the main bug: We need to pass shouldUpdateFocusedIndex, shouldSingleExecuteRowSelect props

For the new bug, I suggest creating a new state and using it instead of autoReportingFrequency.

const [isSelected, setIsSelected] = useState(autoReportingFrequency)

We also need to call setIsSelected(item.keyForList) in the onSelectAutoReportingFrequency function.

We can add a new Save button and only call the API when the user clicks this button. This pattern has been confirmed by the design team here and can also be applied to the WorkspaceAutoReportingFrequencyPage.

What alternative solutions did you explore? (Optional)

@daledah
Copy link
Contributor

daledah commented Aug 16, 2024

Edited by proposal-police: This proposal was edited at 2024-08-16 19:36:01 UTC.

Proposal

Please re-state the problem that we are trying to solve in this issue.

A check mark next to monthly, but there is no selected background

What is the root cause of that problem?

We just updated isSelected and not updated the focused index in here

onSelectRow={() => {
if (shouldSingleExecuteRowSelect) {
singleExecution(() => selectRow(item, index))();
} else {
selectRow(item);
}
}}

What changes do you think we should make in order to solve the problem?

We should add 2 props shouldUpdateFocusedIndex and shouldSingleExecuteRowSelect to SelectionList here

<SelectionList
ListItem={RadioListItem}
sections={[{data: autoReportingFrequencyItems}]}
onSelectRow={onSelectAutoReportingFrequency}
initiallyFocusedOptionKey={autoReportingFrequency}
/>

OPTIONAL: We should pass index to function selectRow in here to reset focusedIndex when props shouldSingleExecuteRowSelect = false

When we call SetWorkspaceAutoReportingFrequency we should set isLoading = true and after the API call is done, it needs to be reset isLoading = false

and we'll disable options when isLoading=true or display them in some way to let users know they need to wait

What alternative solutions did you explore? (Optional)

@cretadn22
Copy link
Contributor

@daledah Your proposal is the same as my proposal 😄

@Krishna2323
Copy link
Contributor

Proposal Updated

  • Added a note.

@daledah
Copy link
Contributor

daledah commented Aug 16, 2024

@cretadn22 I see there is a difference in the OPTIONAL part. In the future when we pass props shouldSingleExecuteRowSelect = false, we can still recalculate the focusIndex.

@puneetlath puneetlath added the External Added to denote the issue can be worked on by a contributor label Aug 16, 2024
Copy link

melvin-bot bot commented Aug 16, 2024

Job added to Upwork: https://www.upwork.com/jobs/~01010057c5f8be0ff8

@melvin-bot melvin-bot bot changed the title There is no selected background after selecting Submission frequency as monthly [$250] There is no selected background after selecting Submission frequency as monthly Aug 16, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 16, 2024
Copy link

melvin-bot bot commented Aug 16, 2024

Current assignee @ZhenjaHorbach is eligible for the External assigner, not assigning anyone new.

@ZhenjaHorbach
Copy link
Contributor

ZhenjaHorbach commented Aug 16, 2024

@Krishna2323 @cretadn22 @daledah
Thanks for your proposals !
All your proposals are correct
But after selecting Submission frequency as monthly we can see that check mark sets with a delay, which is why we see an unpleasant visual bug
I think we should cover this in this issue
Can you please update your proposals to account for that?

Снимок экрана 2024-08-16 в 20 46 02

@cretadn22
Copy link
Contributor

Updated proposal to address the new bug mentioned by @ZhenjaHorbach

@daledah
Copy link
Contributor

daledah commented Aug 16, 2024

@ZhenjaHorbach The bug happened because when we were calling the API SetWorkspaceAutoReportingFrequency and we updated it again with a different value

Updated proposal

Screen.Recording.2024-08-17.at.02.29.12.mov

@ZhenjaHorbach
Copy link
Contributor

Sorry to confuse you 😅
I meant this bug
Since the only way to reproduce it is selecting Submission frequency as monthly
I think it should be fixed.
As you can see we have check mark with a delay

2024-08-16.21.47.41.mov
Снимок экрана 2024-08-16 в 21 48 14

@ZhenjaHorbach
Copy link
Contributor

@ZhenjaHorbach The bug happened because when we were calling the API SetWorkspaceAutoReportingFrequency and we updated it again with a different value

Updated proposal

Screen.Recording.2024-08-17.at.02.29.12.mov

@daledah
But actually thanks for mentioning this bug
But in this case I think it does not concern this issue

@ZhenjaHorbach
Copy link
Contributor

But on the other hand
What do you think ? puneetlath
We have two additional issues

  1. We have check mark with a delay when select Submission frequency as monthly

#47574 (comment)

  1. When we quickly change Submission frequencies several times
    We will see that on the screen Submission frequencies will change one by one until we get the latest current Submission frequency

#47574 (comment)

Or should we fix only the current issue described in the Action Performed?

@melvin-bot melvin-bot bot added the Overdue label Aug 19, 2024
Copy link

melvin-bot bot commented Aug 20, 2024

@puneetlath, @ZhenjaHorbach Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@puneetlath
Copy link
Contributor

Hmm, I think if they all touch this same flow, then let's just fix them here.

@melvin-bot melvin-bot bot removed the Overdue label Aug 20, 2024
@ZhenjaHorbach
Copy link
Contributor

@Krishna2323 @cretadn22 @daledah
Could you update your proposals, please ?

@Krishna2323
Copy link
Contributor

When we quickly change Submission frequencies several times
We will see that on the screen Submission frequencies will change one by one until we get the latest current Submission frequency

@ZhenjaHorbach, I believe this is not related to our current issue, the current bug is related to the UI, so I guess we can solve the other 2 bugs.

@ZhenjaHorbach
Copy link
Contributor

When we quickly change Submission frequencies several times
We will see that on the screen Submission frequencies will change one by one until we get the latest current Submission frequency

@ZhenjaHorbach, I believe this is not related to our current issue, the current bug is related to the UI, so I guess we can solve the other 2 bugs.

It makes sense to me !

@Krishna2323
Copy link
Contributor

@ZhenjaHorbach, I updated my proposal to fix the second visual glitch mentioned here. Please review and let me know when you have some time. Thanks

@ZhenjaHorbach
Copy link
Contributor

@Krishna2323
Thanks for update !
I agree that IsMonthlyFrequency is a bit redundant in this case
So I'm happy to go with this proposal

🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented Aug 21, 2024

Current assignee @puneetlath is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 21, 2024
Copy link

melvin-bot bot commented Aug 21, 2024

📣 @ZhenjaHorbach 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

Copy link

melvin-bot bot commented Aug 21, 2024

📣 @Krishna2323 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@Krishna2323
Copy link
Contributor

@ZhenjaHorbach, PR ready for review ^

@ZhenjaHorbach
Copy link
Contributor

Looks like production deploy automation failed: This should be on [HOLD for Payment 2024-09-06] according to prod deploy checklist, confirmed in slack

@puneetlath
Copy link
Contributor

Ah ok cool. @ZhenjaHorbach can you complete the checklist in that case?

@puneetlath puneetlath changed the title [$250] There is no selected background after selecting Submission frequency as monthly [HOLD for payment 2024-09-06] [$250] There is no selected background after selecting Submission frequency as monthly Sep 6, 2024
ZhenjaHorbach referenced this issue Sep 6, 2024
@ZhenjaHorbach
Copy link
Contributor

BugZero Checklist

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:

  • [@ZhenjaHorbach] The PR that introduced the bug has been identified. Link to the PR:

#42019

  • [ @ZhenjaHorbach] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:

https://github.com/Expensify/App/pull/42019/files#r1747587652

  • [@ZhenjaHorbach] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:

NA

  • [@ZhenjaHorbach] Determine if we should create a regression test for this bug.
  • [@ZhenjaHorbach] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.

Since it's a minor issue with a simple fix that we use in many places
I'm not sure if regression tests are needed here

@ZhenjaHorbach
Copy link
Contributor

Ah ok cool. @ZhenjaHorbach can you complete the checklist in that case?

Done !

@Krishna2323
Copy link
Contributor

@puneetlath, bump for payments 🙏🏻

@puneetlath
Copy link
Contributor

Great, thanks everyone. All paid!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2
Projects
None yet
Development

No branches or pull requests

6 participants