Skip to content

[$500] Scan - notifications@expensify.com only changes to Expensify after opening the message in thread #32581

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!


Version Number: 1.4.8-1
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
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:

Action Performed:

  1. Log in with a new account
  2. Go to any chat
  3. Create a Scan request using an image that will fail the scanning
  4. After the scanning fails, click on the IOU preview twice to open IOU details page
  5. Right click on the "scanning failed" system message > Reply in thread

Expected Result:

In Step 4, the owner of "scanning failed" system message is displayed as Expensify

Actual Result:

In Step 4, the owner of "scanning failed" system message is notifications@expensify.com.
It only changes to Expensify after opening the system message in thread

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

Bug6303292_1701875406689.bandicam_2023-12-06_11-14-52-218.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01e866fa63ee2203e1
  • Upwork Job ID: 1732481608650776576
  • Last Price Increase: 2024-01-03

Activity

  1. added
    External
    Daily
    Bug
    on Dec 6, 2023
  2. changed the title [-]Scan - notifications@expensify.com only changes to Expensify after opening the message in thread[/-] [+][$500] Scan - notifications@expensify.com only changes to Expensify after opening the message in thread[/+] on Dec 6, 2023
  3. melvin-bot commented on Dec 6, 2023

    @melvin-bot

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

  4. melvin-bot commented on Dec 6, 2023

    @melvin-bot
  5. added
    Help Wanted
    on Dec 6, 2023
  6. melvin-bot commented on Dec 6, 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
  7. melvin-bot commented on Dec 6, 2023

    @melvin-bot

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

  8. FitseTLT commented on Dec 6, 2023

    @FitseTLT
    Contributor

    Proposal

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

    notifications@expensify.com only changes to Expensify after opening the message in thread

    What is the root cause of that problem?

    When the personal detail for an account id doesn't exist in ONYXKEYS.PERSONAL_DETAILS_LIST ReportUtils.getDisplayNameForParticipant will return the login/email

    App/src/libs/ReportUtils.ts

    Lines 1403 to 1409 in 5a0b7fd

    const shortName = personalDetails.firstName ? personalDetails.firstName : longName;
    if (!longName && shouldFallbackToHidden) {
    return Localize.translateLocal('common.hidden');
    }
    return shouldUseShortForm ? shortName : longName;
    }

    so the email is displayed but after opening in thread the personal detail for notifications@expensify.com will be inserted in ONYXKEYS.PERSONAL_DETAILS_LIST and ReportUtils.getDisplayNameForParticipant will return the proper display name Expensify and hence Expensify is displayed.

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

    Similar to what we did for concierge we can return custom made personal detail for CONST.ACCOUNT_ID.NOTIFICATIONS below this code
    here

    App/src/libs/ReportUtils.ts

    Lines 1366 to 1373 in 5a0b7fd

    if (Number(accountID) === CONST.ACCOUNT_ID.CONCIERGE) {
    return {
    accountID,
    displayName: 'Concierge',
    login: CONST.EMAIL.CONCIERGE,
    avatar: UserUtils.getDefaultAvatar(accountID),
    };
    }

    if (Number(accountID) === CONST.ACCOUNT_ID.NOTIFICATIONS) {
            return {
                accountID,
                displayName: 'Expensify',
                login: CONST.EMAIL.NOTIFICATIONS,
                avatar: UserUtils.getDefaultAvatar(accountID),
            };
        }
    

    (we can also set avatar to be expensify icon)
    but it is better to return this custom made personal detail only if expensify notifications personal detail is not found in onyx personal details list so that it will return the expensify notifications personal detail from onyx record whenever it exists as the avatar for expensify notification is not the same as user default avatar.
    change this

    App/src/libs/ReportUtils.ts

    Lines 1374 to 1378 in 5a0b7fd

    return (
    allPersonalDetails?.[accountID] ?? {
    avatar: UserUtils.getDefaultAvatar(accountID),
    isOptimisticPersonalDetail: true,
    }

    to

    return (
            allPersonalDetails?.[accountID] ??
            (Number(accountID) === CONST.ACCOUNT_ID.NOTIFICATIONS
                ? {
                      accountID,
                      displayName: 'Expensify',
                      login: CONST.EMAIL.NOTIFICATIONS,
                      avatar: UserUtils.getDefaultAvatar(accountID),
                  }
                : {
                      avatar: UserUtils.getDefaultAvatar(accountID),
                      isOptimisticPersonalDetail: true,
                  })
        );
    

    or in ReportUtils.getDisplayNameForParticipant we return Expensify when accountID is CONST.ACCOUNT_ID.NOTIFICATIONS instead of the email/login when the personal detail doesn't exist in onyx

    What alternative solutions did you explore? (Optional)

  9. Pujan92 commented on Dec 7, 2023

    @Pujan92
    Contributor

    How about adding this required entry in the personalDetailsList itself within the backend 'OpenApp' api response, which can avoid more custom checks in front end

  10. melvin-bot commented on Dec 12, 2023

    @melvin-bot

    @eVoloshchak, @anmurali Eep! 4 days overdue now. Issues have feelings too...

  11. 66 remaining items

  12. removed their assignment
    on Feb 16, 2024
  13. added
    Bug
    and removed
    Bug
    on Feb 16, 2024
  14. melvin-bot commented on Feb 16, 2024

    @melvin-bot

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

  15. added
    Daily
    and removed
    Weekly
    on Feb 16, 2024
  16. self-assigned this
    on Feb 16, 2024
  17. blimpich commented on Feb 16, 2024

    @blimpich
    Contributor

    Still an issue in production. The personal details list now has notifications@expensify.com in it but it doesn't have a display name so it looks the same as before. Just created a PR to give it a display name, then this should be good.

  18. slafortune commented on Feb 19, 2024

    @slafortune
    Contributor

    Thanks for the update @blimpich 🤞

  19. blimpich commented on Feb 19, 2024

    @blimpich
    Contributor

    Updated in production. Display name now works.

    Screen.Recording.2024-02-19.at.12.33.49.PM.mov
  20. blimpich commented on Feb 19, 2024

    @blimpich
    Contributor

    I'm going to do a bit of code cleanup on the frontend, then I will consider this done and close the issue.

  21. melvin-bot commented on Feb 27, 2024

    @melvin-bot

    @eVoloshchak, @slafortune, @anmurali, @blimpich Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  22. blimpich commented on Feb 27, 2024

    @blimpich
    Contributor

    Ah I forgot to close this issue. Frontend changes have been merged and a separate issue was created for paying the C+ contributor here: #37190.

    Since payment is handled in that issue and this issue has been resolved I'm going to close this now.

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

Metadata

Metadata

Labels

BugDailyEngineeringReviewing

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions