Skip to content

[$2000] Chat - Previously enter password disappears after second tap on eye icon and 1 more character #21730

Closed

Description

@lanitochka17

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Issue found when executing PR #21367

Action Performed:

  1. Login to NewDot
  2. Open chat
  3. Tap password protected pdf
  4. Tap Enter password
  5. Type several characters
  6. Tap Icon to view
  7. Tap Icon to hide
  8. Type one more additional character

Expected Result:

Previously entered password should stay

Actual Result:

Previously entered password disappears

Workaround:

Unknown

Platforms:

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

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.33.3

Reproducible in staging?: Yes

Reproducible in production?: Yes

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

Bug6108558_IMG_1618.mp4

Expensify/Expensify Issue URL:

Issue reported by: Applause - Internal Team

Slack conversation:

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0182f352a9471319ec
  • Upwork Job ID: 1679228827688402944
  • Last Price Increase: 2023-07-19

Activity

  1. added
    Daily
    Bug
    on Jun 27, 2023
  2. melvin-bot commented on Jun 27, 2023

    @melvin-bot

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

  3. melvin-bot commented on Jun 27, 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
  4. melvin-bot commented on Jun 30, 2023

    @melvin-bot

    @johncschuster Whoops! This issue is 2 days overdue. Let's get this updated quick!

  5. melvin-bot commented on Jul 4, 2023

    @melvin-bot

    @johncschuster Still overdue 6 days?! Let's take care of this!

  6. johncschuster commented on Jul 6, 2023

    @johncschuster
    Contributor

    @dukenv0307 / @aimane-chnaif, it looks like this behavior was found when executing #21367. Can you take a look?

  7. dukenv0307 commented on Jul 7, 2023

    @dukenv0307
    Contributor

    @johncschuster I can't reproduce this bug

  8. johncschuster commented on Jul 10, 2023

    @johncschuster
    Contributor

    @lanitochka17 are you still able to reproduce this behavior? Please reopen the issue if you can!

  9. added
    Needs Reproduction
    on Jul 10, 2023
  10. 71 remaining items

  11. johncschuster commented on Aug 3, 2023

    @johncschuster
    Contributor

    Do we feel the clarification will change the outcome of needing an expert contributor? If so, I'll wait, otherwise, let's get one assigned now.

  12. shubham1206agra commented on Aug 4, 2023

    @shubham1206agra
    Contributor

    Do we feel the clarification will change the outcome of needing an expert contributor? If so, I'll wait, otherwise, let's get one assigned now.

    @johncschuster I don't think so the expert contributor will tell you a different solution for this. I have tried all kinds of solutions, and there are 2 kinds of solutions right now (apart from the bullet-like workaround suggested by @AirBorne04 ).
    One is mentioned here react/react-native#35668, but this solution has many issues.

    1. It circumvents RN's implementation of text updation completely, which has many event-related calls, such as _onTextInput, _onChange, and _onSelectionChange, which can be important to Native implementation.
    2. It will be applied to all TextInput, whether single-line or multi-line TextInput, and has problems with some languages' text input.

    I suggested another one. It overcomes the problems of the previous ones by doing some extra manipulation during becomeFirstResponder because this is the last place we have the value of text before toggling (more specifically, before marking the textinput to clear values on the next input).

    On setting secureTextEntry or calling becomeFirstResponder kind of marks dirty, i.e., on the next input event it checks the value of secureTextEntry. If it is true, it will reset the input text. Otherwise, it will not.

    @abdulrahuman5196 I think I have written beginEditing by mistake because I inferred the root cause incorrectly at that time. Now, I guess you got the root cause correct.

    About you are storing the attributedText on secureTextEntry change and setting it again in becomeFirstResponder

    The first store you see happens to solve another issue, which is done by RN Team only. And another one is done by me. I think this has to happen in becomeFirstResponder as after this method, it is very difficult to distinguish between input events done by the user and inputs done as the result of secureTextEntry.

    PS: We are calling becomeFirstResponder inside setSecureTextEntry only when the textinput is firstResponder to ensure that we don't accidentally change the focus of the input when not focused.

    @johncschuster @abdulrahuman5196 If you are satisfied with my answer, you can proceed with my proposal. If you have any other questions, please ask.

  13. melvin-bot commented on Aug 7, 2023

    @melvin-bot

    @johncschuster, @abdulrahuman5196 Whoops! This issue is 2 days overdue. Let's get this updated quick!

  14. johncschuster commented on Aug 7, 2023

    @johncschuster
    Contributor

    @abdulrahuman5196 what are your thoughts on the above?

  15. abdulrahuman5196 commented on Aug 8, 2023

    @abdulrahuman5196
    Contributor

    @shubham1206agra I am still not convinced.
    The reason is that the text is disappearing when we type a character not just pressing on the input(becomeFirstResponder would called as soon the component become focus). This means even normally after becomeFirstResponder will have proper attributedText. So I doubt if the solution would work.
    And why are we doing a [self deleteBackward]; Was this solution working locally for you?

  16. shubham1206agra commented on Aug 9, 2023

    @shubham1206agra
    Contributor

    @shubham1206agra I am still not convinced.
    The reason is that the text is disappearing when we type a character not just pressing on the input(becomeFirstResponder would called as soon the component become focus). This means even normally after becomeFirstResponder will have proper attributedText. So I doubt if the solution would work.

    Yes, on focus it will call becomeFirstResponder. But it will try to clear text after typing any letter after focus.

    I will post an example today for the same.

    And why are we doing a [self deleteBackward]; Was this solution working locally for you?

    To trigger all clearing calls that happens on using secureEntryText. Then reinserting the text.
    Yes it's working for me.

  17. shubham1206agra commented on Aug 9, 2023

    @shubham1206agra
    Contributor

    @abdulrahuman5196 See this

    Screen.Recording.2023-08-09.at.11.55.55.AM.mov
  18. SosenWiosen commented on Aug 9, 2023

    @SosenWiosen
    Contributor

    Hi, I'm from Software Mansion, an expert agency. I will investigate this more closely and try to help you close out this issue :)

  19. SosenWiosen commented on Aug 9, 2023

    @SosenWiosen
    Contributor

    I went through all the proposals. I would argue that we shouldn't change this behaviour, as it's the way how it works on IOS natively. It's also how other apps behave, for example strava.

    In this gist I recreated this exact behaviour natively (there's a recording below).

    If we really wanted to change this, we could implement some type of workaround but it would be hacky. I believe we should just leave it be.

    Slack link for further discussion: https://expensify.slack.com/archives/C01GTK53T8Q/p1691589779246999

    @johncschuster @abdulrahuman5196

    Video https://github.com/Expensify/App/assets/43684335/d17fc5f5-602e-4473-9020-e169dee29542
  20. johncschuster commented on Aug 9, 2023

    @johncschuster
    Contributor

    Thanks for raising this, @SosenWiosen! I didn't realize this was native behavior. With that in mind, I agree that we can close this out.

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

Metadata

Metadata

Labels

BugDailyEngineeringInternal

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions