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
3.57k stars 2.91k forks source link

fix clear cached data after account switch #52822

Open huult opened 2 days ago

huult commented 2 days ago

Details

Fixed Issues

$ https://github.com/Expensify/App/issues/48427 PROPOSAL: https://github.com/Expensify/App/issues/48427#issuecomment-2409091556

Tests

Same QA step

Offline tests

QA Steps

  1. Log in to New Dot
  2. Switch to offline mode
  3. Add a comment to a report while offline.
  4. Navigate to the Settings tab in the application.
  5. Reconnect to the internet and quickly log out while the comment request is being made.
  6. Log in with a different account.
  7. Click on the Search icon.
  8. Verify that only reports associated with the second account are displayed in the search results. Reports not linked to the second account should not appear.

PR Author Checklist

Screenshots/Videos

Android: Native https://github.com/user-attachments/assets/0471fb75-e316-47a8-83b4-c34dbfc07fb3
Android: mWeb Chrome https://github.com/user-attachments/assets/fd378c1a-f2cb-4700-94ea-ce1be77f889b
iOS: Native https://github.com/user-attachments/assets/704036cf-1808-4ce9-8bae-085e024306dd
iOS: mWeb Safari https://github.com/user-attachments/assets/4884fde4-d19b-4d2e-83e7-cf9ac27ff7e6
MacOS: Chrome / Safari https://github.com/user-attachments/assets/ce1d604d-fbe4-4da8-93df-1b19fbbb55f3
MacOS: Desktop https://github.com/user-attachments/assets/ad74f23c-a9dd-4867-aa3d-1c00e7f57025
melvin-bot[bot] commented 2 days ago

@getusha 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]

huult commented 1 day ago

@getusha I am checking the reason for the unit test failure.

huult commented 1 day ago

@getusha I added a check for the test environment to skip this code because it doesn't need to be executed during testing. Without this check, the tests would fail since the test data wouldn't be added due to the lack of a session. Can you review it? Let me know if you have any questions.