Skip to content

[HOLD for payment 2023-10-16] [$500] Attachment - Red error message appears briefly when closing password protected PDF #28195

Closed

Description

@kbecciv

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:

Action Performed:

  1. Go any report
  2. Open password protected PDF page
  3. Click close button, Observe error message appears briefly

Expected Result:

No error message after close

Actual Result:

Error message appears briefly after closing password protected PDF

Workaround:

Unknown

Platforms:

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

  • Android / native
  • Android / Chrome
  • iOS / native - did not provided yet, requested
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.74.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
Notes/Photos/Videos: Any additional supporting documentation

Screen.Recording.2023-09-24.at.17.24.22.mov
Recording.4771.mp4

Expensify/Expensify Issue URL:
Issue reported by: @namhihi237
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1695551022734439

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01b3fbc4b9a33f9413
  • Upwork Job ID: 1706411843181993984
  • Last Price Increase: 2023-10-02
  • Automatic offers:
    • jjcoffee | Reviewer | 26985177
    • namhihi237 | Contributor | 26985179
    • namhihi237 | Reporter | 26985182

Activity

  1. added
    External
    Daily
    Bug
    on Sep 25, 2023
  2. changed the title [-]Attachment - Red error message appears briefly when closing password protected PDF[/-] [+][$500] Attachment - Red error message appears briefly when closing password protected PDF[/+] on Sep 25, 2023
  3. melvin-bot commented on Sep 25, 2023

    @melvin-bot

    Triggered auto assignment to @michaelhaxhiu (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

  4. melvin-bot commented on Sep 25, 2023

    @melvin-bot
  5. melvin-bot commented on Sep 25, 2023

    @melvin-bot

    Bug0 Triage Checklist (Main S/O)

    • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
    • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
      • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
    • This bug is reproducible using the reproduction steps in the OP. S/O
      • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
      • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
    • This issue is filled out as thoroughly and clearly as possible
      • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
    • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync
  6. added
    Help Wanted
    on Sep 25, 2023
  7. melvin-bot commented on Sep 25, 2023

    @melvin-bot

    Triggered auto assignment to @NicMendonca (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

  8. melvin-bot commented on Sep 25, 2023

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @jjcoffee (External)

  9. kbecciv commented on Sep 25, 2023

    @kbecciv
    Author

    Proposal by: @namhihi237
    Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1695551022734439

    Proposal

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

    Error message appears briefly after closing password-protected PDF, It also when we click download

    What is the root cause of that problem?

    We call the function check error when blur input:

    onBlur={validateAndNotifyPasswordBlur}

    In the function validateAndNotifyPasswordBlur we call validate function. That means when we click outside the input> it will tricker and show an error.
    const validateAndNotifyPasswordBlur = () => {
    validate();
    onPasswordFieldFocused(false);
    };

    const validate = () => {
    if (!isPasswordInvalid && !_.isEmpty(password)) {
    return true;
    }
    if (_.isEmpty(password)) {
    setValidationErrorText('attachmentView.passwordRequired');
    }
    return false;
    };

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

    I think we can remove validation when blur input. We only check when click confirm.

    What alternative solutions did you explore? (Optional)

    N/A

  10. DylanDylann commented on Sep 26, 2023

    @DylanDylann
    Contributor

    Proposal

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

    We have 2 bugs:

    1. Red error message appears briefly when closing password password-protected PDF
    2. Red error appear as soon as the app is put in background (ref: [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)
    Screen.Recording.2023-09-26.at.17.09.37.mov

    What is the root cause of that problem?

    const validateAndNotifyPasswordBlur = () => {
    validate();
    onPasswordFieldFocused(false);
    };

    This function will be triggered, even though user click on close button or put app in background

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

    We should trigger the validate function on blur only when the current app is visible and has focus. And then we can use setTimeOut to delay validation like this

    const validateAndNotifyPasswordBlur = () => {
            // Only run validation when user proactively blurs the input.
            if (!Visibility.isVisible() || !Visibility.hasFocus()) {
                return
            }
            setTimeout(() => {
                validate();
                onPasswordFieldFocused(false);
            }, 300);
        }
    

    This is the way we did in Form Component and used in many places

    setTimeout(() => {

    result

    Screen-Recording-2023-09-26-at-17.06.09.mp4
  11. 35 remaining items

  12. added
    Awaiting Payment
    on Oct 9, 2023
  13. changed the title [-][$500] Attachment - Red error message appears briefly when closing password protected PDF[/-] [+][HOLD for payment 2023-10-16] [$500] Attachment - Red error message appears briefly when closing password protected PDF[/+] on Oct 9, 2023
  14. melvin-bot commented on Oct 9, 2023

    @melvin-bot

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

  15. removed
    Reviewing
    on Oct 9, 2023
  16. melvin-bot commented on Oct 9, 2023

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.79-5 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-10-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.

    • External issue reporter
    • Contributor that fixed the issue
    • Contributor+ that helped on the issue and/or PR

    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:

    • Merged PR within 3 business days of assignment - 50% bonus
    • Merged PR more than 9 business days after assignment - 50% penalty
  17. melvin-bot commented on Oct 9, 2023

    @melvin-bot

    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:

    • [@jjcoffee] The PR that introduced the bug has been identified. Link to the PR:
    • [@jjcoffee] 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:
    • [@jjcoffee] 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:
    • [@jjcoffee] Determine if we should create a regression test for this bug.
    • [@jjcoffee] 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.
    • [@NicMendonca] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
  18. added
    Daily
    and removed
    Weekly
    Daily
    on Oct 16, 2023
  19. NicMendonca commented on Oct 16, 2023

    @NicMendonca
    Contributor

    @jjcoffee bump on the BZ check list ^

  20. NicMendonca commented on Oct 16, 2023

    @NicMendonca
    Contributor

    everyone has been paid 🎉 @jjcoffee @namhihi237

  21. jjcoffee commented on Oct 17, 2023

    @jjcoffee
    Contributor
    • The PR that introduced the bug has been identified. Link to the PR: N/A - behaviour always existed
    • 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: N/A
    • 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: N/A
    • Determine if we should create a regression test for this bug. No - not really impactful enough
    • 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.
  22. NicMendonca commented on Oct 17, 2023

    @NicMendonca
    Contributor

    all set here then!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentBugDailyExternal

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions