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 payment 2025-01-30] [$250] Invoice - "Hidden" name shown when creating invoice for non existing user #54211
Version Number: v9.0.76-6 Reproducible in staging?: Yes Reproducible in production?: No If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A If this was caught during regression testing, add the test name, ID and link from TestRail: N/A Email or phone of affected tester (no customers):testpayment935+796@gmail.com Issue reported by: Applause Internal Team Device used: Windows 10 / Chrome App Component: Other
Please re-state the problem that we are trying to solve in this issue.
Hidden user is shown when sending an invoice to a user we never chatted before.
What is the root cause of that problem?
I can't fully reproduce the issue. In my testing, the Hidden only shows on the header name. Based on the QA recording, looks like there is some BE problem too.
When we send a new invoice to a user we never chatted before, we will optimistically create a new personal details for that user. Then, we get the invoice room name from the receiver account ID and the personal details list.
However, the issue happens when the header is rendered before the personal details list optimistic data is merged. The allPersonalDetails is coming from the lib Onyx.connect which won't trigger a re-render when the personal detail is updated.
But actually, on the HeaderView, we already subscribed to the personal details list Onyx using useOnyx and passed it to getReportName, so whenever the personal details list is updated, the getReportName will be called again.
So, it should re-trigger getInvoicesChatName when the personal details are updated. However, the allPersonalDetails list here is updated later after the useOnyx hook.
changed the title [-]Invoice - Random user name generates when creating invoice for non existing user[/-][+][$250] Invoice - Random user name generates when creating invoice for non existing user[/+]on Dec 18, 2024
changed the title [-][$250] Invoice - Random user name generates when creating invoice for non existing user[/-][+][$250] Invoice - "Hidden" name shown when creating invoice for non existing user[/+]on Dec 18, 2024
@jjcoffee@twisterdotcom@jjcoffee The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
changed the title [-][HOLD for payment 2025-01-30] [HOLD for payment 2025-01-28] [$250] Invoice - "Hidden" name shown when creating invoice for non existing user[/-][+][HOLD for payment 2025-01-30] [$250] Invoice - "Hidden" name shown when creating invoice for non existing user[/+]on Jan 28, 2025
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue:
Regression Test Proposal
Precondition:
Have a workspace with invoices enabled
Test:
Send an invoice to a new user you have never chatted with before
Verify the header and report preview doesn't show Hidden
Activity
melvin-bot commentedon Dec 16, 2024
Triggered auto assignment to @twisterdotcom (
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.bernhardoj commentedon Dec 17, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
Hidden user is shown when sending an invoice to a user we never chatted before.
What is the root cause of that problem?
I can't fully reproduce the issue. In my testing, the Hidden only shows on the header name. Based on the QA recording, looks like there is some BE problem too.
When we send a new invoice to a user we never chatted before, we will optimistically create a new personal details for that user. Then, we get the invoice room name from the receiver account ID and the personal details list.
App/src/libs/ReportUtils.ts
Lines 3928 to 3930 in d86024e
However, the issue happens when the header is rendered before the personal details list optimistic data is merged. The
allPersonalDetailsis coming from the lib Onyx.connect which won't trigger a re-render when the personal detail is updated.But actually, on the HeaderView, we already subscribed to the personal details list Onyx using
useOnyxand passed it togetReportName, so whenever the personal details list is updated, thegetReportNamewill be called again.App/src/pages/home/HeaderView.tsx
Line 77 in d86024e
App/src/pages/home/HeaderView.tsx
Line 97 in d86024e
So, it should re-trigger
getInvoicesChatNamewhen the personal details are updated. However, theallPersonalDetailslist here is updated later after theuseOnyxhook.App/src/libs/ReportUtils.ts
Lines 3928 to 3930 in d86024e
So, even though the function is re-triggered, the
allPersonalDetailsstill holds the old value.What changes do you think we should make in order to solve the problem?
Pass the personal details from the component to
getInvoicesChatNameApp/src/libs/ReportUtils.ts
Lines 4084 to 4086 in d86024e
And use it here
App/src/libs/ReportUtils.ts
Lines 3916 to 3930 in d86024e
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
This requires a UI test where we need to assert that the HeaderView of invoice room title is updated when the personal detail is updated.
[-]Invoice - Random user name generates when creating invoice for non existing user[/-][+][$250] Invoice - Random user name generates when creating invoice for non existing user[/+]melvin-bot commentedon Dec 18, 2024
Job added to Upwork: https://www.upwork.com/jobs/~021869525665327494178
melvin-bot commentedon Dec 18, 2024
Triggered auto assignment to Contributor-plus team member for initial proposal review - @jjcoffee (
External)[-][$250] Invoice - Random user name generates when creating invoice for non existing user[/-][+][$250] Invoice - "Hidden" name shown when creating invoice for non existing user[/+]35 remaining items
melvin-bot commentedon Jan 23, 2025
@jjcoffee @twisterdotcom @jjcoffee The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
[-][HOLD for payment 2025-01-30] [HOLD for payment 2025-01-28] [$250] Invoice - "Hidden" name shown when creating invoice for non existing user[/-][+][HOLD for payment 2025-01-30] [$250] Invoice - "Hidden" name shown when creating invoice for non existing user[/+]twisterdotcom commentedon Jan 29, 2025
Waiting for tomorrow and also the BZ checklist.
jjcoffee commentedon Jan 29, 2025
BugZero Checklist:
Bug classification
Source of bug:
Where bug was reported:
Who reported the bug:
[Contributor] 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/44970/files#r1934051853
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue:
Regression Test Proposal
Precondition:
Test:
Do we agree 👍 or 👎
melvin-bot commentedon Jan 30, 2025
Payment Summary
Upwork Job
BugZero Checklist (@twisterdotcom)
twisterdotcom commentedon Jan 30, 2025
Payment Summary:
bernhardoj commentedon Jan 30, 2025
Requested in ND.
JmillsExpensify commentedon Jan 31, 2025
$250 approved for @bernhardoj
garrettmknight commentedon Feb 3, 2025
$250 approved for @jjcoffee