Skip to content

The role changes with no error when assign the Approve-only role to a member offline #104946

Closed as not planned

Description

@applause-bot

If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.


Version Number: v9.5.20-0
Reproducible in staging?: Yes
Reproducible in production?: N/A - new feature, doesn't exist in prod
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #102933
Email or phone of affected tester (no customers): lekima20+628010@gmail.com
Issue reported by: Applause Internal Team
Bug source: Pull Request QA execution
Device used: Win 11/Chrome
App Component: Workspace Settings

Action Performed:

  1. Open https://staging.new.expensify.com
  2. Navigate to a control workspace setting > Members tab
  3. Invite a user who already has a default workspace as Approve-only
  4. Go offline
  5. Change the Approve-only role to Member

Expected Result:

Verify the role does not change and an error is shown on the member row

Actual Result:

The role is changed with no error

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7294861_1792793866553.Recording__2612.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Mita Rachim
Bug ID: 7294861

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on Oct 26, 2026
  2. melvin-bot commented on Oct 26, 2026

    @melvin-bot

    @flodnv recently merged #102933, but they are OOO right now, so I'll auto-assign someone else.

  3. applause-bot commented on Oct 26, 2026

    @applause-bot
    Author

    While Applause doesn't embed attachments for this bug, here are the links for quick view:
    https://platform.applause.com/services/links/v1/external/b87359f52863e16de0d03cafba3fffc8fc65ed286abef8474c521556ebcd4a94

  4. melvin-bot commented on Oct 26, 2026

    @melvin-bot

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

  5. github-actions commented on Oct 26, 2026

    @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.
  6. melvin-bot commented on Oct 26, 2026

    @melvin-bot

    @flodnv @Pujan92 you have been assigned to this deploy blocker because you reviewed the offending PR: #102933

  7. melvin-bot commented on Oct 26, 2026

    @melvin-bot

    @ShridharGoel you have been assigned to this deploy blocker because you authored the offending PR: #102933

  8. melvin-bot commented on Oct 26, 2026

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  9. MelvinBot commented on Oct 26, 2026

    @MelvinBot
    Contributor

    Deploy Blocker Analysis

    Recommendation: demote and close. This is not a regression. The app behaves as designed. When you change a role offline, the change applies right away and no error shows until you reconnect. QA's expected result came from an outdated "Offline tests" section in [Payment due @Pujan92] Add approve-only workspace role. That section no longer matches the merged code.

    Confidence: High. This is based on the code and the PR history. I did not run a live test.

    Investigation details
    • The PR moved to the standard offline-first pattern before merge. Commit b97f3c5a9f changed the role update to a queued API.write. After that change, the author wrote on the PR: "now it would change the role optimistically and then check for the blockers when the user gets online. If there's at least one blocker, then it would show the modal as expected and revert the optimistic role change."
    • The PR description was never updated. The "Offline tests" section still says "Verify the role does not change and an error is shown on the member row." QA Steps says "Same as tests," so QA copied the stale text.
    • The optimistic update sets the new role with a pending marker. See Member.ts#L617-L632. The request is queued at Member.ts#L737. The role reverts and an error shows only if the server rejects the change after you reconnect (Member.ts#L651-L669).
    • The blocked-role modal depends on the server response. useApproveOnlyRoleBlockedModal.ts#L31-L74 reacts only to BLOCKED_ROLE_CHANGE from the server. Nothing in the app sets it locally, so the modal cannot appear offline.
    • QA tested a change that the server never blocks. QA changed Approve-only to Member. The server blocks a role change only when Approve-only is the role being assigned. So this change should succeed even after you reconnect.
    • Every offline role change already works this way in production. For example, Admin to Member also applies right away offline.

    Suggested follow-up: ShridharGoel, please update the PR's "Offline tests" section to match the merged behavior. For example: "Go offline. Assign Approve-only to a member who has a blocker, such as a card on the workspace. Verify the role updates and shows as pending. Go back online. Verify the blocked-reasons modal appears and the role reverts."


    Next Steps: Reply with @MelvinBot <your feedback> to refine this analysis.


    view run

  10. ShridharGoel commented on Oct 26, 2026

    @ShridharGoel
    Contributor

    Updated the outdated offline tests

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.EngineeringHourlyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions