Skip to content

Vacation delegate - Workspace are not arranged in alphabetical order #101498

Closed

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: 9.4.84-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: #99460
Email or phone of affected tester (no customers): jsdoijnodsdisojo@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.5 / Chrome
App Component: User Settings

Action Performed:

Precondition:

  • Create a few workspaces.
  1. Go to staging.new.expensify.com
  2. Go to Account > Profile > Status.
  3. Click Vacation delegate.
  4. Enter an existing user email who is not workspace member.
  5. Click on the user.

Expected Result:

Workspaces will be arranged in alphabetical order.

Actual Result:

Workspace are not arranged in alphabetical order.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7262819_1789688509728.1.mp4

View all open jobs on GitHub

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

Issue OwnerCurrent Issue Owner: @mkhutornyi
Issue OwnerCurrent Issue Owner: @mkhutornyi

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on Sep 18, 2026
  2. applause-bot commented on Sep 18, 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/6ac948918377037ab84f2e7869c409ee8131d588dab8847c70c64350ab0f5beb

  3. melvin-bot commented on Sep 18, 2026

    @melvin-bot

    You have been assigned to this deploy blocker because you recently merged this PR: #99460

  4. github-actions commented on Sep 18, 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.
  5. melvin-bot commented on Sep 18, 2026

    @melvin-bot

    @mountiny @mkhutornyi you have been assigned to this deploy blocker because you reviewed the offending PR: #99460

  6. melvin-bot commented on Sep 18, 2026

    @melvin-bot

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

  7. melvin-bot commented on Sep 18, 2026

    @melvin-bot

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

  8. MelvinBot commented on Sep 18, 2026

    @MelvinBot
    Contributor

    🔍 Investigation Summary

    Classification: Frontend bug
    Causing PR: feat: Replace vacation delegate policy diff warning with RHP invite step - "feat: Replace vacation delegate policy diff warning with RHP invite step" by @jakubstec (High confidence)
    Related Issues: Vacation delegate: adjust the policy diff warning (the issue PR #99460 implemented)

    Recommendation: ROLL FORWARD

    The bug is a missing client-side sort in a brand-new RHP page — a few-line fix in WorkspaceSection/index.tsx is far safer and smaller than reverting a 5-file, ~380-line feature PR (plus 612 lines of tests) that also removed the old blocking policy-diff warning it replaced. Reverting would restore the previously-rejected warning UX to fix a purely cosmetic ordering issue.

    Assigned: @jakubstec (PR author), @mountiny and @mkhutornyi (approving reviewers) from highest-confidence causing PR only — already assigned by melvin-bot, no change needed
    Labels: No changes. DeployBlockerCash is kept (an App PR caused this, and the issue is not reproducible on production). DeployBlocker was not present, so nothing was removed.

    📋 Detailed Analysis

    Evidence

    Verification

    Affected files (all added by PR #99460):

    A repo-wide grep for policyDiff|adminPolicies|nonAdminPolicies across src/ shows no sort or localeCompare anywhere in this flow, so the omission is not compensated for further up or down the chain. No test in tests/ui/VacationDelegateMissingWorkspacesPageTest.tsx asserts row ordering, so adding a sort will not break existing tests.

    Root Cause

    policyDiff is stored verbatim from the SetVacationDelegate 305 (POLICY_DIFF_WARNING) response into the vacation-delegate NVP (src/libs/actions/VacationDelegate.ts#L102-L110). Its adminPolicies and nonAdminPolicies are plain string[] of policy IDs (src/types/onyx/VacationDelegate.ts#L4-L11) whose order carries no meaning.

    index.tsx passes those arrays through unchanged, and WorkspaceSection maps over policyIDs directly to render one WorkspaceRow each. Because the display name is only resolved inside WorkspaceRow (policy?.name ?? translate('workspace.common.unavailable')), the list is ordered by whatever sequence the API returned the IDs in, never by the name the user actually sees. Hence the non-alphabetical order.

    This is squarely an App-side fix: the response is well-formed and the ordering of an ID array is not something the backend should be relied on to guarantee — presentation order belongs in the client.

    Suggested fix: resolve each row's title in WorkspaceSection and sort by it with the locale-aware comparator before rendering, matching the pattern used elsewhere in the app (const {translate, localeCompare} = useLocalize();, then sort). Two things to be careful about:

    1. Do not sort in place. policyIDs is the Onyx-owned array (vacationDelegate.policyDiff.adminPolicies); .sort() mutates its receiver, so copy first ([...policyIDs].sort(...)).
    2. Sort by the resolved title (including the workspace.common.unavailable fallback), not by policyID, so the order matches what is rendered. No useMemo — this file compiles under React Compiler.

    adminWorkspaces in index.tsx (used for the actual invite call) is unaffected; its order has no user-visible or functional meaning.

  9. 15 remaining items

  10. changed the title [-]Vacation delegate - Workspace are not arranged in alphabetical order[/-] [+][Due for payment 2026-09-28] Vacation delegate - Workspace are not arranged in alphabetical order[/+] on Sep 21, 2026
  11. melvin-bot commented on Sep 21, 2026

    @melvin-bot

    @mkhutornyi

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.90-2 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2026-09-28. 🎊

    The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]

  12. changed the title [-][Due for payment 2026-09-28] Vacation delegate - Workspace are not arranged in alphabetical order[/-] [+]Vacation delegate - Workspace are not arranged in alphabetical order[/+] on Sep 24, 2026
  13. mallenexpensify commented on Sep 24, 2026

    @mallenexpensify
    Contributor

    Partial reminder to self, payment isn't due here.

    yeah I think that makes sense, but we keep #101498 without reward then as a follow up

  14. mkhutornyi commented on Sep 24, 2026

    @mkhutornyi
    Contributor

    We can close this

  15. melvin-bot commented on Sep 24, 2026

    @melvin-bot

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

  16. melvin-bot commented on Sep 28, 2026

    @melvin-bot

    @mkhutornyi Whoops! This issue is 2 days overdue. Let's get this updated quick!

  17. melvin-bot commented on Sep 29, 2026

    @melvin-bot

    @mkhutornyi Eep! 4 days overdue now. Issues have feelings too...

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

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions