Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[$250] mWeb - Workspace - Website closes when using device´s back button after requesting to join WS #58496

Open
1 of 8 tasks
jponikarchuk opened this issue Mar 14, 2025 · 6 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors

Comments

@jponikarchuk
Copy link

jponikarchuk commented Mar 14, 2025

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 9.1.13-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team
Device used: Motorola MotoG60 - Android 12 - Chrome
App Component: Other

Action Performed:

Prerequisite: Have two different accounts opened in two different environments or devices.

  1. Open the staging.new.expensify.com website.
  2. Log in with User A account.
  3. Switch to User B account.
  4. Tap on "Settings" and select "Workspaces"
  5. Open any workspace and tap on "Overview"
  6. Tap on "Share" and copy the URL.
  7. Switch to User A account again.
  8. Open Self DM and send the URL.
  9. Tap on the URL.
  10. After landing on workspaces list, use device´s back button to return to chat,
  11. If no action is triggered, repeat the action.
  12. Check the website behaviour after this action.

Expected Result:

User should return to chat, after navigating to link to request to join a workspace, and using device´s back button.

Actual Result:

After tapping on link to request to join a workspace, landing on workspaces list, and using device´s back button, the website closes instead of returning to chat.

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6770395_1741963846751.b8e2b153-1d1b-4cf9-9cfb-99ae2a586349.mp4

Logs.txt

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021900607145212180837
  • Upwork Job ID: 1900607145212180837
  • Last Price Increase: 2025-03-14
Issue OwnerCurrent Issue Owner: @dukenv0307
@jponikarchuk jponikarchuk added Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 labels Mar 14, 2025
Copy link

melvin-bot bot commented Mar 14, 2025

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

@garrettmknight garrettmknight added the External Added to denote the issue can be worked on by a contributor label Mar 14, 2025
@melvin-bot melvin-bot bot changed the title mWeb - Workspace - Website closes when using device´s back button after requesting to join WS [$250] mWeb - Workspace - Website closes when using device´s back button after requesting to join WS Mar 14, 2025
Copy link

melvin-bot bot commented Mar 14, 2025

Job added to Upwork: https://www.upwork.com/jobs/~021900607145212180837

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Mar 14, 2025
@garrettmknight garrettmknight moved this to Bugs and Follow Up Issues in [#whatsnext] #expense Mar 14, 2025
Copy link

melvin-bot bot commented Mar 14, 2025

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

@nkdengineer
Copy link
Contributor

nkdengineer commented Mar 14, 2025

🚨 Edited by proposal-police: This proposal was edited at 2025-03-14 19:01:38 UTC.

Proposal

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

After tapping on link to request to join a workspace, landing on workspaces list, and using device´s back button, the website closes instead of returning to chat.

What is the root cause of that problem?

After requesting to join WS, navigateAfterJoinRequest function is called. This function calls multiple navigation at the same time, which causes the navigation state to be incorrect.

const navigateAfterJoinRequest = () => {
Navigation.goBack(undefined, {shouldPopToTop: true});
if (getIsSmallScreenWidth()) {
Navigation.navigate(ROUTES.SETTINGS);
}
Navigation.navigate(ROUTES.SETTINGS_WORKSPACES.route);
};
export default navigateAfterJoinRequest;

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

We need to wait the navigation to complete before processing the next one

Navigation.goBack(undefined, {shouldPopToTop: true}); 
 if (getIsSmallScreenWidth()) { 
     Navigation.setNavigationActionToMicrotaskQueue(() => {
        Navigation.navigate(ROUTES.SETTINGS);
    });
 } 
 Navigation.setNavigationActionToMicrotaskQueue(() => {
      Navigation.navigate(ROUTES.SETTINGS_WORKSPACES.route);
  })

const navigateAfterJoinRequest = () => {
Navigation.goBack(undefined, {shouldPopToTop: true});
if (getIsSmallScreenWidth()) {
Navigation.navigate(ROUTES.SETTINGS);
}
Navigation.navigate(ROUTES.SETTINGS_WORKSPACES.route);
};
export default navigateAfterJoinRequest;

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

Wrong using navigation function

What alternative solutions did you explore? (Optional)

Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

@dukenv0307
Copy link
Contributor

@nkdengineer's proposal looks good to me. We used the same idea in

App/src/libs/actions/IOU.ts

Lines 5091 to 5095 in 703cdf4

Navigation.dismissModal(isSearchTopmostFullScreenRoute() ? undefined : activeReportID);
if (action === CONST.IOU.ACTION.SHARE) {
if (isSearchTopmostFullScreenRoute() && activeReportID) {
Navigation.setNavigationActionToMicrotaskQueue(() => {

🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented Mar 17, 2025

Triggered auto assignment to @rafecolton, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors
Projects
Status: Bugs and Follow Up Issues
Development

No branches or pull requests

5 participants