Skip to content

[$250] Workspace - One of the approver still appears in employe's WS chat after removing it in OD #79435

Closed

Description

@nlemma

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.2.99-8
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from BrowserStack: https://test-management.browserstack.com/projects/2219752/test-runs/TR-2769/folder/13176709/41236921/1119954416?sort=%2Bidentifier
Email or phone of affected tester (no customers): poipio514+owner2@gmail.com
Issue reported by: Applause Internal Team
Bug source: Regression TC Execution
Device used: Windows 11 / Chrome
App Component: Workspace Settings

Action Performed:

Preconditions:
Prepare 4 accounts:

  • Workspace Owner
  • Employee
  • Approver 1
  • Approver 2

The Owner has a controlled workspace with an advanced approval workflow:

  • Employee submits to Approver 1
  • Approver 2 is the final approver

Steps:

  1. Log in as the Employee.
  2. Create an expense in the workspace and submit it for approval.
  3. Log in as the Owner.
  4. Navigate to OldDot (OD).
  5. Remove Approver 1 and Approver 2 from the approval workflow so they are no longer approvers, and set all approval steps to the Owner.
  6. Navigate back to NewDot (ND).
  7. Go to the employee’s workspace chat and open the expense created in step 2.

Expected Result:

  • Approver 1 has been removed from the chat member list.
  • The next approver shown is the workspace Owner.

Actual Result:

  • Approver 1 is still displayed in the chat member list.
  • The next approver shown is Approver 1.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari

Screenshots/Videos

Bug7047710_1768292138677.remove_approver.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022013264868881335802
  • Upwork Job ID: 2013264868881335802
  • Last Price Increase: 2026-04-14
Issue OwnerCurrent Issue Owner: @francoisl

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jan 13, 2026
  2. melvin-bot commented on Jan 13, 2026

    @melvin-bot

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

  3. melvin-bot commented on Jan 17, 2026

    @melvin-bot

    @CortneyOfstad Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  4. CortneyOfstad commented on Jan 19, 2026

    @CortneyOfstad
    Contributor

    Getting eyes on this!

  5. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jan 19, 2026
  6. changed the title [-]Workspace - One of the approver still appears in employe's WS chat after removing it in OD[/-] [+][$250] Workspace - One of the approver still appears in employe's WS chat after removing it in OD[/+] on Jan 19, 2026
  7. melvin-bot commented on Jan 19, 2026

    @melvin-bot
  8. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jan 19, 2026
  9. melvin-bot commented on Jan 19, 2026

    @melvin-bot

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

  10. annaweber830 commented on Jan 20, 2026

    @annaweber830
    Contributor

    Proposal

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

    After an owner edits a workspace’s advanced approval workflow in OldDot (removing approvers and setting approvals to the owner), NewDot does not immediately reflect those changes. In the employee’s workspace chat, one removed approver still appears in the Members list, and the “next approver” shown in next steps remains the old approver instead of the owner.

    What is the root cause of that problem?

    When switching back from OldDot → NewDot, the NewDot client can continue using stale Onyx state (policy employeeList/approval chain and/or report participants) because we don’t reliably refresh/fetch incremental updates on transition. As a result, UI logic that derives:

    • room members from report.participants, and
    • next approver from the policy’s approval chain / submit-to rules
      keeps showing outdated approver data until some later refresh occurs.

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

    • Trigger an automatic reconnectApp after an OldDot → NewDot transition (both web transition route and HybridApp return), using the latest applied update ID so the server returns incremental Onyx updates.
    • This forces NewDot to pull the newest policy/workflow + report participant data right after the transition, so:
      removed approvers are no longer listed as workspace chat members, and
      “next approver” updates to the owner as expected.
      let isHybridAppSetupFinished = false;
      let hasSwitchedAccountInHybridMode = false;
    let isHybridAppSetupFinished = false;
    let hasSwitchedAccountInHybridMode = false;
    
    let lastUpdateIDAppliedToClient: number | undefined;
    Onyx.connectWithoutView({
        key: ONYXKEYS.ONYX_UPDATES_LAST_UPDATE_ID_APPLIED_TO_CLIENT,
        callback: (value) => {
            lastUpdateIDAppliedToClient = value;
        },
    });
    
    

    .then(() =>
    Promise.all([
    HybridAppActions.prepareHybridAppAfterTransitionToNewDot({
    ...hybridApp,
    closingReactNativeApp: false,
    }),
    ...Object.entries(newDotOnyxValues).map(([key, value]) => Onyx.merge(key as OnyxKey, value ?? {})),
    ]),
    )
    .then(() => {
    Log.info('[HybridApp] Setup after transition from OldDot finished');
    isHybridAppSetupFinished = true;
    return Promise.resolve();
    })

    .then(() =>
                Promise.all([
                    HybridAppActions.prepareHybridAppAfterTransitionToNewDot({
                        ...hybridApp,
                        closingReactNativeApp: false,
                    }),
                    ...Object.entries(newDotOnyxValues).map(([key, value]) => Onyx.merge(key as OnyxKey, value ?? {})),
                ]),
            )
            .then(() => {
                reconnectApp(lastUpdateIDAppliedToClient ?? 0);
            })
            .then(() => {
                Log.info('[HybridApp] Setup after transition from OldDot finished');
                isHybridAppSetupFinished = true;
                return Promise.resolve();
            })
    

    let hasLoadedApp: boolean | undefined;
    Onyx.connectWithoutView({
    key: ONYXKEYS.HAS_LOADED_APP,
    callback: (value) => {
    hasLoadedApp = value;
    resolveHasLoadedAppPromise?.();
    },
    });

    let hasLoadedApp: boolean | undefined;
    Onyx.connectWithoutView({
        key: ONYXKEYS.HAS_LOADED_APP,
        callback: (value) => {
            hasLoadedApp = value;
            resolveHasLoadedAppPromise?.();
        },
    });
    
    let lastUpdateIDAppliedToClient: number | undefined;
    Onyx.connectWithoutView({
        key: ONYXKEYS.ONYX_UPDATES_LAST_UPDATE_ID_APPLIED_TO_CLIENT,
        callback: (value) => {
            lastUpdateIDAppliedToClient = value;
        },
    });
    

    App/src/libs/actions/App.ts

    Lines 586 to 588 in e54cfd4

    const isTransitioning = Str.startsWith(url.pathname, Str.normalizeUrl(ROUTES.TRANSITION_BETWEEN_APPS));
    const shouldCreateFreePolicy = !isLoggingInAsNewUser && isTransitioning && exitTo === ROUTES.WORKSPACE_NEW;

    const isTransitioning = Str.startsWith(url.pathname, Str.normalizeUrl(ROUTES.TRANSITION_BETWEEN_APPS));
    
        if (isTransitioning) {
            reconnectApp(lastUpdateIDAppliedToClient ?? 0);
        }
    
        const shouldCreateFreePolicy = !isLoggingInAsNewUser && isTransitioning && exitTo === ROUTES.WORKSPACE_NEW;
        
    

    What alternative solutions did you explore? (Optional)

  11. 95 remaining items

  12. melvin-bot commented on Apr 14, 2026

    @melvin-bot

    📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

  13. melvin-bot commented on Apr 14, 2026

    @melvin-bot

    @francoisl 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

  14. CortneyOfstad commented on Apr 16, 2026

    @CortneyOfstad
    Contributor

    Bump @francoisl on the comment here — thanks!

  15. melvin-bot commented on Apr 16, 2026

    @melvin-bot

    @francoisl 8 days overdue is a lot. Should this be a Weekly issue? If so, feel free to change it!

  16. huult commented on Apr 17, 2026

    @huult
    Contributor

    Same

  17. melvin-bot commented on Apr 17, 2026

    @melvin-bot

    📣 @tradego579! 📣
    Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
    Please follow these steps:

    1. Make sure you've read and understood the contributing guidelines.
    2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
    3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
    4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
      Screen Shot 2022-11-16 at 4 42 54 PM
      Format:
    Contributor details
    Your Expensify account email: <REPLACE EMAIL HERE>
    Upwork Profile Link: <REPLACE LINK HERE>
    
  18. francoisl commented on Apr 17, 2026

    @francoisl
    Contributor

    Sorry I haven't had time to look into this yet, hoping to get to it soon 🤞

  19. CortneyOfstad commented on Apr 20, 2026

    @CortneyOfstad
    Contributor

    No worries — thanks @francoisl!

  20. melvin-bot commented on Apr 20, 2026

    @melvin-bot

    @francoisl Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  21. francoisl commented on Apr 20, 2026

    @francoisl
    Contributor

    I don't think this is a bug, changing the approval workflow of a workspace just doesn't edit the current approver on processing reports. We also can't change this behavior for Classic, because submitters can choose to submit reports to someone else than their submitsTo if approval workflows are not strictly enforced.

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

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributorsretest-weeklyApply this label if you want this issue tested on a Weekly basis by Applause

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions