You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[HOLD for #16296][$1000] pronouns search breaks when we reload on pronouns search page #20095
You'll be redirected to the Profile Page > click Pronoun again
Search for another pronoun but do not select it
Refresh browser
You'll see the pronoun you've previously selected after the page load
Search and Select a different pronoun
You'll be redirected to the Profile Page.
Click on the Pronouns menu item again.
You'll notice that this time, the chosen pronoun is not prefilled in the search box, which should be the expected behaviour.
Expected Result:
Pronouns search page should display current selection when opened
Actual Result:
Pronouns search page displays blank result with blank search if we search anything, reload, select any result and reopen the search page.
Workaround:
Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
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.22-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
this is really difficult to reproduce - I can't get it to happen consistently with the above steps... It sees like just a bug with the loading or something?
Please re-state the problem that we are trying to solve in this issue.
In this issue, we can notice that when we refresh the website on the Pronouns page, change the pronoun and navigate back to the pronouns page, the default selected option is not displayed.
What is the root cause of that problem?
Another component that uses a similar mechanism is the Select Timezone page. You will notice that the bug is not reproducible in this page, thus confirming this is indeed an issue with this page.
This is an issue with the component lifecycle and the state. In the normal lifecycle of the component, the loadPronouns function is called, which sets the initiallyFocusedOption and then the state's searchValue obtains it's value from it.
When we refresh the site on the Pronouns Page, choose a pronoun, then the this.onChangeText(); function is called, setting the searchValue to be empty. Then, the loadPronouns function updates the this.initiallyFocusedOption. At this point however, since we only set the state search value in the constructor, it causes the empty string to be used.
What changes do you think we should make in order to solve the problem?
We should update the state searchValue after the loadPronouns function is called in the componentDidUpdate with the value this.initiallyFocusedOption.text.
What alternative solutions did you explore? (Optional)
@Christinadobrzyn The repro steps are indeed a bit vague, here is a bit readable way to reproduce this error:
Login to ND.
Go to Settings > Profile > Pronouns Page.
Refresh the website.
Enter a text in the search box and select a new pronoun.
You'll be redirected to the Profile Page.
Click on the Pronouns menu item again.
You'll notice that this time, the chosen pronoun is not prefilled in the search box, which should be the expected behaviour.
In order to confirm this is a bug on this page, you can try to reproduce this bug on the Select a Timezone Page. You'll notice that on Step 7, the new timezone is prefilled in the search box, confirming this is a bug on the Pronouns Page.
changed the title [-] pronouns search breaks when we reload on pronouns search page[/-][+][$1000] pronouns search breaks when we reload on pronouns search page[/+]on Jun 5, 2023
@priyeshshah11 you are eligible for the speed bonus per this comment - #16296 (comment) were you not paid that extra 50%?
@Christinadobrzyn No I did not & I don't think I am even eligible for that 50% bonus but what I was referring to was the compensation for fixing #20095.
In terms of a reporting payment, this GH was created internally so there were no external reporters (at least from what I can see)
However, on occasion, we will compensate external contributors who report the same issue that was found by an internal QA team or engineer. That was the case here.
@dhanashree-sawant found a bug that we were already fixing in #16296. Since there was no external reporter, I chose to compensate @dhanashree-sawant for finding this bug. Also I'm paying out @Prince-Mendiratta because they were monumental in helping me narrow down the bug.
Related to this comment #20095 (comment) - so this GH is basically an exception. Hopefully that clarifies but let me know if you have any questions!
@Christinadobrzyn i believe we should pay @priyeshshah11 here for this fix too as his pr resolved this bug while also migrated to the functional component which was paid in the other issue.
Activity
melvin-bot commentedon Jun 2, 2023
Triggered auto assignment to @Christinadobrzyn (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Jun 2, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)Christinadobrzyn commentedon Jun 2, 2023
this is really difficult to reproduce - I can't get it to happen consistently with the above steps... It sees like just a bug with the loading or something?
Prince-Mendiratta commentedon Jun 3, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
In this issue, we can notice that when we refresh the website on the Pronouns page, change the pronoun and navigate back to the pronouns page, the default selected option is not displayed.
What is the root cause of that problem?
Another component that uses a similar mechanism is the Select Timezone page. You will notice that the bug is not reproducible in this page, thus confirming this is indeed an issue with this page.
This is an issue with the component lifecycle and the state. In the normal lifecycle of the component, the
loadPronounsfunction is called, which sets theinitiallyFocusedOptionand then the state'ssearchValueobtains it's value from it.When we refresh the site on the Pronouns Page, choose a pronoun, then the
this.onChangeText();function is called, setting thesearchValueto be empty. Then, theloadPronounsfunction updates thethis.initiallyFocusedOption. At this point however, since we only set the state search value in the constructor, it causes the empty string to be used.What changes do you think we should make in order to solve the problem?
We should update the state
searchValueafter theloadPronounsfunction is called in thecomponentDidUpdatewith the valuethis.initiallyFocusedOption.text.What alternative solutions did you explore? (Optional)
None
Prince-Mendiratta commentedon Jun 3, 2023
@Christinadobrzyn The repro steps are indeed a bit vague, here is a bit readable way to reproduce this error:
In order to confirm this is a bug on this page, you can try to reproduce this bug on the Select a Timezone Page. You'll notice that on Step 7, the new timezone is prefilled in the search box, confirming this is a bug on the Pronouns Page.
Christinadobrzyn commentedon Jun 5, 2023
@Prince-Mendiratta - this is soooo helpful and thoughtful of you to test/clarify. I am able to reproduce it. Going to add an external to this.
Prince-Mendiratta commentedon Jun 5, 2023
@Christinadobrzyn Glad to be able to help! :)
[-] pronouns search breaks when we reload on pronouns search page[/-][+][$1000] pronouns search breaks when we reload on pronouns search page[/+]melvin-bot commentedon Jun 5, 2023
Job added to Upwork: https://www.upwork.com/jobs/~01c81d6b609195757b
33 remaining items
dhanashree-sawant commentedon Jul 4, 2023
Hi @Christinadobrzyn, yes now it is working correct. Seems to be resolved.
priyeshshah11 commentedon Jul 4, 2023
@Christinadobrzyn No I did not & I don't think I am even eligible for that 50% bonus but what I was referring to was the compensation for fixing #20095.
Christinadobrzyn commentedon Jul 5, 2023
@priyeshshah11 from what I can see in the Upwork job https://www.upwork.com/jobs/~010517ed943d1f3420, you were paid for your work on #16296. If there was an issue with that payment can you please comment in the other GH?
In terms of a reporting payment, this GH was created internally so there were no external reporters (at least from what I can see)
However, on occasion, we will compensate external contributors who report the same issue that was found by an internal QA team or engineer. That was the case here.
@dhanashree-sawant found a bug that we were already fixing in #16296. Since there was no external reporter, I chose to compensate @dhanashree-sawant for finding this bug. Also I'm paying out @Prince-Mendiratta because they were monumental in helping me narrow down the bug.
Related to this comment #20095 (comment) - so this GH is basically an exception. Hopefully that clarifies but let me know if you have any questions!
Christinadobrzyn commentedon Jul 5, 2023
Yay! Paying out this GH based on my comment here - #20095 (comment)
@Prince-Mendiratta $250
@dhanashree-sawant $250
closed Upwork job https://www.upwork.com/jobs/~01c81d6b609195757b
Closing this issue! Thanks!
mountiny commentedon Jul 8, 2023
@Christinadobrzyn i believe we should pay @priyeshshah11 here for this fix too as his pr resolved this bug while also migrated to the functional component which was paid in the other issue.
I believe that would be $1000 for the pr to them.
Let me know if anything if this works 🙇
Christinadobrzyn commentedon Jul 10, 2023
Awesome, sent an offer to a new Upwork job -
Internal job - https://www.upwork.com/ab/applicants/1678512838515896320/job-details
External job - https://www.upwork.com/jobs/~01ec86bf1d98921bf1
@priyeshshah11 Let me know when you've accepted the job and I'll pay it out!
aimane-chnaif commentedon Jul 10, 2023
Coming from #16296 (comment), I might also be eligible.
mountiny commentedon Jul 10, 2023
Yep C+ should be paid the same as the contributor.
Christinadobrzyn commentedon Jul 10, 2023
Invited @aimane-chnaif also to the Upwork job. The job is these links #20095 (comment)
I'm very confused as I thought we pay in the Upwork job related to the fix so that is this job #16296 (comment)
Since @aimane-chnaif and @priyeshshah11 aren't assigned to this GH. I'm confused I pay @rushatgabhane as they are assigned to this job?
priyeshshah11 commentedon Jul 11, 2023
@Christinadobrzyn Accepted, thanks 😊
Christinadobrzyn commentedon Jul 11, 2023
Awesome! I paid @aimane-chnaif and @priyeshshah11 $1000 for the fix of #16296 (comment)
I think this is good? Let me know if anything else needs to happen! Thanks
rushatgabhane commentedon Jul 12, 2023
no pay for me here. good to close