Skip to content

[$250] Group - App crash when removing a member on the process splitting expense #46805

Closed

Description

@izarutskaya

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: v9.0.16-4
Reproducible in staging?: Y
Reproducible in production?: N
Email or phone of affected tester (no customers): dave0123seife@gmail.com
Logs: https://stackoverflow.com/c/expensify/questions/4856
Issue reported by: Applause-Internal team

Action Performed:

  1. As User A Create a group chat with User B While viewing both accounts
  2. go to user B > navigate to the group chat created
  3. Click on the + button on the composer box > Split Expense
  4. Enter amount > Click next. Don't finish the flow
  5. As User A,While User B is the confirmation page, remove user B from the group.

Expected Result:

Error is shown

Actual Result:

App Crash

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

Bug6562221.1722857270352.Screen.Recording.2024-08-05.At.1.56.25.Pm.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~013d4e761b19949e81
  • Upwork Job ID: 1820614678720926546
  • Last Price Increase: 2024-08-06
  • Automatic offers:
    • ishpaul777 | Contributor | 103413818
Issue OwnerCurrent Issue Owner: @RachCHopkins

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    DeployBlockerIndicates it should block deploying the API
    on Aug 5, 2024
  2. melvin-bot commented on Aug 5, 2024

    @melvin-bot

    Triggered auto assignment to @cristipaval (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

  3. melvin-bot commented on Aug 5, 2024

    @melvin-bot

    Triggered auto assignment to @RachCHopkins (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.

  4. github-actions commented on Aug 5, 2024

    @github-actions
    Contributor

    👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  5. melvin-bot commented on Aug 5, 2024

    @melvin-bot

    ⚠️ Looks like this issue was linked to a Deploy Blocker here

    If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

    If a regression has occurred and you are the assigned CM follow the instructions here.

    If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

  6. daledah commented on Aug 5, 2024

    @daledah
    Contributor

    Edited by proposal-police: This proposal was edited at 2024-08-06 04:08:22 UTC.

    Proposal

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

    App Crash

    What is the root cause of that problem?

    we use useOnyx to get policy In

    const [policy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${report?.policyID || -1}`);

    When user A add user B from group, the report?.policyId is _FAKE_ -> we get policy__FALE_
    when A remove B, report?.report will be undefined -> we get policy_-1

    In we have the logic to detect if policy__FALE_ and policy_-1 have the same collection key

    https://github.com/Expensify/react-native-onyx/blob/115542b601349d13114bf6784f645e44c02816d1/lib/useOnyx.ts#L112

    But the logic to extract the collection key (splitCollectionMemberKey) is wrong

    https://github.com/Expensify/react-native-onyx/blob/115542b601349d13114bf6784f645e44c02816d1/lib/OnyxUtils.ts#L409

    we're using lastIndexOf to get the index of _ -> the collection key of policy__FALE_ is policy__FALE_
    the collection key of policy_-1 is policy_

    -> the condition is failed

    -> the error is throw here

    https://github.com/Expensify/react-native-onyx/blob/115542b601349d13114bf6784f645e44c02816d1/lib/useOnyx.ts#L121-L123

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

    Create usePolicy hook to handle the policyID-defaulting logic

     const [policy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${report.policyID === CONST.POLICY.OWNER_EMAIL_FAKE ? '-1' : report.policyID ?? '-1'}`); 
    

    What alternative solutions did you explore? (Optional)

  7. daledah commented on Aug 5, 2024

    @daledah
    Contributor

    @cristipaval I can raise the PR soon if you agree with the solution. Thanks

  8. 43 remaining items

  9. RachCHopkins commented on Sep 9, 2024

    @RachCHopkins
    Contributor

    Sorry @daledah did you apply for the upwork job per this comment? I do see one shortlisted proposal but I'm not 100% sure it's you.

  10. RachCHopkins commented on Sep 9, 2024

    @RachCHopkins
    Contributor

    Ok, no it's not, I found your upwork profile and that is not you. I will set up the job again and send you another offer @daledah

    @ishpaul777 forgive me if this is a silly question - did you get paid for this offer?

  11. ishpaul777 commented on Sep 9, 2024

    @ishpaul777
    Contributor

    @ishpaul777 forgive me if this is a silly question - did you get paid for this offer?

    Yes thats the offer i accepted, here's the contract https://www.upwork.com/nx/wm/workroom/38035610

  12. RachCHopkins commented on Sep 10, 2024

    @RachCHopkins
    Contributor

    What I mean is, did you get paid money for it @ishpaul777 ?

  13. ishpaul777 commented on Sep 10, 2024

    @ishpaul777
    Contributor

    What I mean is, did you get paid money for it @ishpaul777 ?

    No, on automatic offers A BZ member need to release payment manually when the payment is due, i.e. 7 days after PR deplyed to Prod.

  14. RachCHopkins commented on Sep 11, 2024

    @RachCHopkins
    Contributor

    Thanks for confirmation @ishpaul777 - I was looking at totally the wrong page! I've paid that out.

    @daledah I'm just waiting on you to accept the proposal (and two others) so I can pay you.

  15. RachCHopkins commented on Sep 12, 2024

    @RachCHopkins
    Contributor

    Payment Summary:

    • Contributor: @daledah to be paid $250 via Upwork - Update: Paid 16 Sept
    • Contributor+: @ishpaul777 paid $250 via Upwork

    Upwork job here

  16. RachCHopkins commented on Sep 16, 2024

    @RachCHopkins
    Contributor

    Contributor has been paid, the contract has been completed, and the Upwork post has been closed.

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.DailyKSv2EngineeringExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions