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-01-31] [$500] Settings - On clear after never, status save does not work #33168

Closed
6 tasks done
kbecciv opened this issue Dec 15, 2023 · 33 comments
Closed
6 tasks done
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor

Comments

@kbecciv
Copy link

kbecciv commented Dec 15, 2023

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: v1.4.13-4
Reproducible in staging?: y
Reproducible in production?: n
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: Applause - Internal Team
Slack conversation:

Action Performed:

  1. Open the app
  2. If status already set then open the status by clicking besides settings OR set status from settings->profile->status and reopen status page
  3. Set 'clear after' to never and save
  4. Again open status and make any changes to message or emoji
  5. Click on save and observe that now app does nothing

Expected Result:

App should save the status on click on save on status page

Actual Result:

App does nothing on click on save when clear after is set to Never on last save

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

Add any screenshot/video evidence

Bug6314365_1702637389033.ios_native_-_clear_after_never_save_not_working.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01c57d019eaab2d964
  • Upwork Job ID: 1736919348213882880
  • Last Price Increase: 2024-01-10
  • Automatic offers:
    • bernhardoj | Contributor | 28105137
@kbecciv kbecciv added the DeployBlockerCash This issue or pull request should block deployment label Dec 15, 2023
Copy link
Contributor

👋 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:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

Copy link

melvin-bot bot commented Dec 15, 2023

Triggered auto assignment to @johnmlee101 (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

@Julesssss
Copy link
Contributor

FYI, another status bug was raised here. Perhaps both were caused by the same PR

@bernhardoj
Copy link
Contributor

bernhardoj commented Dec 15, 2023

az## Proposal

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

After selecting NEVER as the clear after value and saving it, trying to update the status emoji/message doesn't work anymore.

What is the root cause of that problem?

If we select NEVER as the clear after value, we will save it as an empty string and so does the BE return it as an empty string.

User.updateCustomStatus({
text: statusText,
emojiCode,
clearAfter: clearAfterTime !== CONST.CUSTOM_STATUS_TYPES.NEVER ? clearAfterTime : '',
});

When we try to update again by changing the emoji/message, it will fail here because clearAfterTime is an empty string.

const clearAfterTime = draftClearAfter || currentUserClearAfter;
const isValid = DateUtils.isTimeAtLeastOneMinuteInFuture({dateTimeString: clearAfterTime});
if (!isValid && clearAfterTime !== CONST.CUSTOM_STATUS_TYPES.NEVER) {
setBrickRoadIndicator(isValidClearAfterDate() ? null : CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR);
return;
}

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

We should fall back the value of clearAfterTime to CONST.CUSTOM_STATUS_TYPES.NEVER.

const clearAfterTime = draftClearAfter || currentUserClearAfter || CONST.CUSTOM_STATUS_TYPES.NEVER;

What alternative solutions did you explore? (Optional)

The question that might arise is, why the error message doesn't show? It's because isValidClearAfterDate returns true. In isValidClearAfterDate, we return true if the clear after value is either NEVER or an empty string.

const isValidClearAfterDate = useCallback(() => {
const clearAfterTime = draftClearAfter || currentUserClearAfter;
if (clearAfterTime === CONST.CUSTOM_STATUS_TYPES.NEVER || clearAfterTime === '') {
return true;
}

So, another way to fix is, return early only if clear after value is not empty.

if (!isValid && clearAfterTime !== '' && clearAfterTime !== CONST.CUSTOM_STATUS_TYPES.NEVER) {

@Pujan92
Copy link
Contributor

Pujan92 commented Dec 17, 2023

Proposal

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

Once we set a status with clear never option, updating status again isn't working

What is the root cause of that problem?

For a clear after Never option we are setting an empty string here.

User.updateCustomStatus({
text: statusText,
emojiCode,
clearAfter: clearAfterTime !== CONST.CUSTOM_STATUS_TYPES.NEVER ? clearAfterTime : '',
});

But on mount while setting the draft status we are not using an empty string as Never here.

useEffect(() => {
if (!currentUserEmojiCode && !currentUserClearAfter && !draftClearAfter) {
User.updateDraftCustomStatus({clearAfter: DateUtils.getEndOfToday()});
} else {
User.updateDraftCustomStatus({clearAfter: currentUserClearAfter});
}

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

On mount logic consider an empty string as a value Never for draft custom status bcoz the else block will executes when we have existing status details.

User.updateDraftCustomStatus({clearAfter: currentUserClearAfter || CONST.CUSTOM_STATUS_TYPES.NEVER});

User.updateDraftCustomStatus({clearAfter: currentUserClearAfter});

@melvin-bot melvin-bot bot added the Overdue label Dec 18, 2023
@jasperhuangg jasperhuangg added Daily KSv2 and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels Dec 19, 2023
@melvin-bot melvin-bot bot removed the Overdue label Dec 19, 2023
@jasperhuangg
Copy link
Contributor

We discussed here and decided this isn't a deploy blocker since it's a back-end issue

@jasperhuangg
Copy link
Contributor

Marking this as Internal since it should be a BE issue

@jasperhuangg jasperhuangg added the Internal Requires API changes or must be handled by Expensify staff label Dec 19, 2023
Copy link

melvin-bot bot commented Dec 19, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01c57d019eaab2d964

Copy link

melvin-bot bot commented Dec 19, 2023

Triggered auto assignment to Contributor Plus for review of internal employee PR - @thesahindia (Internal)

@Pujan92
Copy link
Contributor

Pujan92 commented Dec 19, 2023

@jasperhuangg isn't this a front-end issue where we are not setting the correct value for draft status clearAfter?

@melvin-bot melvin-bot bot added the Overdue label Dec 21, 2023
Copy link

melvin-bot bot commented Dec 22, 2023

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

Copy link

melvin-bot bot commented Dec 26, 2023

@johnmlee101, @thesahindia 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

Copy link

melvin-bot bot commented Dec 28, 2023

@johnmlee101, @thesahindia 8 days overdue is a lot. Should this be a Weekly issue? If so, feel free to change it!

Copy link

melvin-bot bot commented Jan 1, 2024

@johnmlee101, @thesahindia 12 days overdue now... This issue's end is nigh!

1 similar comment
Copy link

melvin-bot bot commented Jan 1, 2024

@johnmlee101, @thesahindia 12 days overdue now... This issue's end is nigh!

@jasperhuangg
Copy link
Contributor

jasperhuangg commented Jan 2, 2024

@Pujan92 I've asked for clarification with @stitesExpensify since he's been in charge of the back-end fix for this.

@DylanDylann
Copy link
Contributor

Proposal

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

App does nothing on click on save when clear after is set to Never on last save

What is the root cause of that problem?

We have inconsistency between FE and BE when we set clear after: never

  • In FE, we save clear after: never as draft
    Screenshot 2024-01-15 at 14 45 21

  • But when calling API we pass clear after:'' as a parameter and the BE also returns clear after:''

So that we should accept both values: 'never' and empty string for this case

if (!isValid && clearAfterTime !== CONST.CUSTOM_STATUS_TYPES.NEVER) {

But here we don't check if clearAfterTime isn't empty string

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

I think we only should make it consistent and only use one value: "never" or empty string for both FE and BE

  1. If using empty string, we don't need to update from BE. We only need to update draft value in the FE to empty string instead of "never" and replace the condition to empty string instead of "never"
  2. If using "never" value (I think it will be more clear), we need to update from BE side to return clear after: never in FE we also replace some places to use "never" value instead of empty string

What alternative solutions did you explore? (Optional)

NA

@thesahindia
Copy link
Member

Missed the notification for this! Will review the proposals today!

@melvin-bot melvin-bot bot removed the Overdue label Jan 15, 2024
@thesahindia
Copy link
Member

@bernhardoj's proposal will do the job!

🎀 👀 🎀 C+ reviewed

Copy link

melvin-bot bot commented Jan 16, 2024

Current assignees @johnmlee101 and @stitesExpensify are 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 Jan 17, 2024
Copy link

melvin-bot bot commented Jan 17, 2024

📣 @bernhardoj 🎉 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 📖

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Jan 17, 2024
@bernhardoj
Copy link
Contributor

PR is ready

cc: @thesahindia

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Jan 24, 2024
@melvin-bot melvin-bot bot changed the title [$500] Settings - On clear after never, status save does not work [HOLD for payment 2024-01-31] [$500] Settings - On clear after never, status save does not work Jan 24, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jan 24, 2024
Copy link

melvin-bot bot commented Jan 24, 2024

Reviewing label has been removed, please complete the "BugZero Checklist".

Copy link

melvin-bot bot commented Jan 24, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.30-1 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 2024-01-31. 🎊

For reference, here are some details about the assignees on this issue:

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Jan 30, 2024
@johnmlee101
Copy link
Contributor

Holding on payment still

Copy link

melvin-bot bot commented Jan 31, 2024

Issue is ready for payment but no BZ is assigned. @adelekennedy you are the lucky winner! Please verify the payment summary looks correct and complete the checklist. Thanks!

@adelekennedy
Copy link

Payouts due:

Contributor: $500 @bernhardoj (Upwork)
Contributor+: $500 @thesahindia (NewDot)

Upwork job is here.

@JmillsExpensify
Copy link

$500 approved for @thesahindia

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests