Skip to content

[HOLD for payment 2023-11-17] [$250] Clean the usage of double onyx call on profile page #29165

Closed

Description

@techievivek

Problem

We currently have used a double onyx call on the profile page to subscribe to the DM chat report in order for notification preference to update correctly for the profile page. This was reported during PR review here: #28200 (comment)

// eslint-disable-next-line rulesdir/no-multiple-onyx-in-file
withOnyx({
report: {
key: ({route, session}) => {
const accountID = Number(lodashGet(route.params, 'accountID', 0));
if (Number(session.accountID) === accountID || Session.isAnonymousUser()) {
return null;
}
return `${ONYXKEYS.COLLECTION.REPORT}${lodashGet(ReportUtils.getChatByParticipants([accountID]), 'reportID', '')}`;
},
},
}),

Discussed here: #28200 (comment)

Why is this important?

Using a double Onyx subscription for any component is not a recommended practice so it would be nice to clean that up. Moreover, we have now enabled the notification preference option for all the chat reports so maybe we can create a separate component for the notification preference page and reuse that across various pages.

Solution

Create a separate component for notification preference and get rid of the double onyx call on the profile page. Feel free to come up with your own solutions.

Here is a potential solution to the problem: #28200 (comment)

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~013768a6222352d168
  • Upwork Job ID: 1711676109112000512
  • Last Price Increase: 2023-10-24
  • Automatic offers:
    • pradeepmdk | Contributor | 27435339

Activity

  1. added
    ExternalAdded to denote the issue can be worked on by a contributor
    FirstPickEngineering only, please! Only add when there is an identified code solution.
    Help WantedApply this label when an issue is open to proposals by contributors
    BugSomething is broken. Auto assigns a BugZero manager.
    on Oct 10, 2023
  2. self-assigned this
    on Oct 10, 2023
  3. melvin-bot commented on Oct 10, 2023

    @melvin-bot
  4. melvin-bot commented on Oct 10, 2023

    @melvin-bot

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

  5. melvin-bot commented on Oct 10, 2023

    @melvin-bot
  6. melvin-bot commented on Oct 10, 2023

    @melvin-bot

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

  7. techievivek commented on Oct 10, 2023

    @techievivek
    ContributorAuthor

    Bug0 triage checklist is not required for this GH, as this is just a code improvement issue.

  8. alexxxwork commented on Oct 10, 2023

    @alexxxwork
    Contributor

    Is it available without a proposal? I would like to take it.

  9. 45 remaining items

  10. melvin-bot commented on Nov 10, 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:

    • [@burczu] The PR that introduced the bug has been identified. Link to the PR:
    • [@burczu] 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:
    • [@burczu] 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:
    • [@burczu] Determine if we should create a regression test for this bug.
    • [@burczu] 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.
    • [@johncschuster] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
  11. pradeepmdk commented on Nov 21, 2023

    @pradeepmdk
    Contributor

    bump for payment

  12. pradeepmdk commented on Nov 25, 2023

    @pradeepmdk
    Contributor

    @johncschuster bump for payment

  13. techievivek commented on Dec 4, 2023

    @techievivek
    ContributorAuthor

    Gentle bump @johncschuster ^

  14. burczu commented on Dec 11, 2023

    @burczu
    Contributor

    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:

    • [@burczu] The PR that introduced the bug has been identified. Link to the PR:

    This was just refactor of an existing feature.

    • [@burczu] 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

    • [@burczu] 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

    • [@burczu] Determine if we should create a regression test for this bug.

    As this was just a refactor, I guess we should expect regression tests for this feature: #27394 should cover testing this issue.

    • [@burczu] 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.
    • [@johncschuster] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
  15. pradeepmdk commented on Dec 13, 2023

    @pradeepmdk
    Contributor

    @johncschuster bump for payment

  16. pradeepmdk commented on Dec 16, 2023

    @pradeepmdk
    Contributor

    @techievivek can u help me for payment here

  17. johncschuster commented on Dec 18, 2023

    @johncschuster
    Contributor

    Sorry I dropped the ball, @pradeepmdk. I'll get payment issued this morning.

  18. pradeepmdk commented on Dec 18, 2023

    @pradeepmdk
    Contributor

    Thank you @johncschuster

  19. johncschuster commented on Dec 18, 2023

    @johncschuster
    Contributor

    Payment has been issued! Thanks for your patience!

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

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.EngineeringExternalAdded to denote the issue can be worked on by a contributorFirstPickEngineering only, please! Only add when there is an identified code solution.WeeklyKSv2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions