Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
4.03k stars 3.03k forks source link

Prevent app crash on web and desktop when switching between delegator and user accounts #56395

Closed c3024 closed 1 week ago

c3024 commented 1 week ago

Explanation of Change

This PR checks if HybridAppModules exists before calling a function on it like it does everywhere else on the App.

Fixed Issues

$ https://github.com/Expensify/App/pull/54296#discussion_r1940447656 PROPOSAL: https://github.com/Expensify/App/pull/54296#discussion_r1940447656

Tests

Prerequisite:

  1. User A is a copilot (delegate) for User B (delegator).

Steps:

  1. Logon to User A on ND.
  2. Click on Settings.
  3. On the top left of the left hand pane, click on the account switcher Avatar to switch to the delegator account (User B).
  4. Verify that the app does not crash and there is no error thrown in the console.
  5. Switch back to the main account (User A) from the account switcher.
  6. Verify that the app does not crash and there is no error thrown in the console.

Offline tests

QA Steps

// TODO: These must be filled out, or the issue title must include "[No QA]."

Same as Tests

PR Author Checklist

Screenshots/Videos

Android: Native https://github.com/user-attachments/assets/0612a3fd-514a-429a-9f82-69e55af451f2
Android: mWeb Chrome https://github.com/user-attachments/assets/98c87dff-334c-4e33-877f-5b568562420a
iOS: Native https://github.com/user-attachments/assets/8d42c742-67ee-4efb-b6b9-2c927446e1c2
iOS: mWeb Safari https://github.com/user-attachments/assets/075d08e2-1c72-4ba0-b616-82c73e2f4198
MacOS: Chrome / Safari https://github.com/user-attachments/assets/c41f3835-0a9c-4cd7-ab70-fb4a458198a6
MacOS: Desktop https://github.com/user-attachments/assets/05263d4f-be85-4156-baf1-cbbb83f26e55
melvin-bot[bot] commented 1 week ago

@mjasikowski Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

c3024 commented 1 week ago

Context here.

cc: @dangrous

mjasikowski commented 1 week ago

Reviewer Checklist

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop
OSBotify commented 1 week ago

:hand: This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

dangrous commented 1 week ago

thanks @c3024!

github-actions[bot] commented 1 week ago

šŸš€ Deployed to staging by https://github.com/mjasikowski in version: 9.0.95-0 šŸš€

platform result
šŸ¤– android šŸ¤– success āœ…
šŸ–„ desktop šŸ–„ success āœ…
šŸŽ iOS šŸŽ success āœ…
šŸ•ø web šŸ•ø success āœ…
šŸ¤–šŸ”„ android HybridApp šŸ¤–šŸ”„ success āœ…
šŸŽšŸ”„ iOS HybridApp šŸŽšŸ”„ success āœ…
github-actions[bot] commented 6 days ago

šŸš€ Deployed to production by https://github.com/Julesssss in version: 9.0.95-6 šŸš€

platform result
šŸ¤– android šŸ¤– true āŒ
šŸ–„ desktop šŸ–„ success āœ…
šŸŽ iOS šŸŽ success āœ…
šŸ•ø web šŸ•ø success āœ…
šŸ¤–šŸ”„ android HybridApp šŸ¤–šŸ”„ failure āŒ
šŸŽšŸ”„ iOS HybridApp šŸŽšŸ”„ failure āŒ