Skip to content

[Due for payment 2026-09-22] [Vacation Delegate Invite] [FE] Replace the policy diff warning modal with an invite step page in the RHP #99078

Closed

Description

@rayane-d

Part of https://github.com/Expensify/Expensify/issues/668027

Context

SetVacationDelegate with overridePolicyDiffWarning: false returns jsonCode 305 with data.policyDiff = {adminPolicies, nonAdminPolicies} (two lists of policy IDs, split by whether the requester is an admin) when the delegate is missing from some workspaces. The server writes nothing on a 305. NewDot ignores the data and only shows a generic confirm modal (VacationDelegatePage.tsx#L71-L88).

Changes

Replace the modal with a step in the RHP that renders one of three variations:

  1. Admin of none (adminPolicies empty): explain that the admins will get an email. One button, "Confirm".
  2. Admin of all (nonAdminPolicies empty): offer "Invite" and "Skip".
  3. Admin of some (both lists filled): show both sections, offer "Invite" and "Skip".

If there is no diff, the first call sets the delegate and the step never appears. Workspace names and avatars come from the local policy_ Onyx collection.

Image
Button API calls Emails
Confirm SetVacationDelegate(overridePolicyDiffWarning=true) sent
Invite one AddMembersToWorkspace per admin policy, then SetVacationDelegate(overridePolicyDiffWarning=true) sent for the non-admin workspaces in the mixed case
Skip SetVacationDelegate(overridePolicyDiffWarning=true, skipPolicyInviteEmails=true) none
  • Add skipPolicyInviteEmails to SetVacationDelegateParams and pass it through the setVacationDelegate action.
  • Read response.data.policyDiff instead of discarding it.
  • "Invite" loops the existing addMembersToWorkspace action, one call per admin policy (per the bulk-action guideline and the 1:1:1 rule), then calls SetVacationDelegate.
  • The 305 response merges an error object into nvp_private_vacationDelegate, so every exit path from the step must clear it.

Notes:

  • skipPolicyInviteEmails is a new optional parameter on SetVacationDelegate (added in a separate backend issue). When true, the backend sets the delegate and sends no email to any workspace admin.
  • On the "Confirm" and "Invite" paths, the backend emails one owner per missing workspace where the user is not an admin, with the other admins in cc, and only where the user is in that workspace's approval workflow. Admin workspaces never get an email.
  • The invites should be sent before the final SetVacationDelegate, and the backend recomputes the diff, so freshly workspaces invites no longer trigger the admins emails.
  • The delegate always gets their own "you are now a vacation delegate" email, including on "Skip".
  • Other error codes (invalid delegate, delegate on vacation, account not found) keep the existing error modal behavior.
Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. self-assigned this
    on Aug 20, 2026
  2. added
    InternalRequires API changes or must be handled by Expensify staff
    on Aug 20, 2026
  3. mountiny commented on Aug 21, 2026

    @mountiny
    Contributor

    Jakub 🤝 Rayane 🤝 Vit

  4. jakubstec commented on Aug 21, 2026

    @jakubstec
    Member

    😎🙏

  5. rayane-d commented on Aug 21, 2026

    @rayane-d
    ContributorAuthor

    🤝💪🚀

  6. melvin-bot commented on Aug 24, 2026

    @melvin-bot

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

  7. jakubstec commented on Aug 25, 2026

    @jakubstec
    Member

    @rayane-d @mountiny
    I have a question, why in the non-admin-only variation (first screen in PR description) Skip isn't available? In the mixed variation I assume it suppresses emails also for nonAdminPolicies. Is it intentional? Should the non-admin-only include Skip option, or should Skip in the mixed one still email admins of nonAdminPolicies? I see it as some possible inconsistence😄

  8. rayane-d commented on Aug 25, 2026

    @rayane-d
    ContributorAuthor

    @rayane-d @mountiny I have a question, why in the non-admin-only variation (first screen in PR description) Skip isn't available? In the mixed variation I assume it suppresses emails also for nonAdminPolicies. Is it intentional? Should the non-admin-only include Skip option, or should Skip in the mixed one still email admins of nonAdminPolicies? I see it as some possible inconsistence😄

    @trjExpensify @Expensify/design, could you please clarify this? Would it make more sense to replace "Confirm" button with two explicit actions: "Ask admins to invite them" and "Skip"?

  9. 34 remaining items

  10. changed the title [-][Vacation Delegate Invite] [FE] Replace the policy diff warning modal with an invite step page in the RHP[/-] [+][Due for payment 2026-09-22] [Vacation Delegate Invite] [FE] Replace the policy diff warning modal with an invite step page in the RHP[/+] on Sep 22, 2026
  11. melvin-bot commented on Sep 22, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  12. mountiny commented on Sep 22, 2026

    @mountiny
    Contributor

    @mkhutornyi can you please suggest regression tests to add for this new feature

  13. mkhutornyi commented on Sep 22, 2026

    @mkhutornyi
    Contributor

    Contributor+ Checklist:

    • [Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

      Link to the comment on the PR: new feature
      Link to the comment on the Issue:

    • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.

      Link to discussion:

    • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

    Regression Test Proposal

    Precondition:

    Test:

    1. Go to Settings > Status > Vacation delegate.
    2. Select a user missing only from workspaces you don't administer > verify the RHP shows just the
      "member of" section and a single "Confirm" button > tap Confirm > verify the delegate is saved.
    3. Select a user missing only from workspaces you do administer > verify the RHP shows just the "admin
      of" section with Invite/Skip buttons > tap Invite > verify the delegate is saved and the user is
      added as a member to each listed workspace.
    4. Select a user missing from a mix of both > verify the RHP shows both sections with Invite/Skip
      buttons > tap Skip > verify the delegate is saved without adding the user to any workspace.
    5. Repeat any of the above, but dismiss the RHP (back button/swipe) before tapping a button > verify the
      delegate reverts to what it was before.

    Do we agree 👍 or 👎

  14. mkhutornyi commented on Sep 22, 2026

    @mkhutornyi
    Contributor

    Deploy Blocker #101498 was identified to be related to this PR.

    @mountiny can I waive penalty for this one? I thought this was not bug.

  15. mountiny commented on Sep 22, 2026

    @mountiny
    Contributor

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

  16. melvin-bot commented on Sep 22, 2026

    @melvin-bot

    Payment Summary

    Resolving PRs:

    BugZero Checklist (@mallenexpensify)

    • I have confirmed assignees, roles, and Upwork contracts look correct
    • I have paid out Upwork contracts / manual NewDot requests
    • [BugZero Assignee] I have created a GH issue for creating/updating the regression test once above steps have been agreed upon
  17. mallenexpensify commented on Sep 24, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @mkhutornyi due $250 via NewDot

  18. trjExpensify commented on Oct 1, 2026

    @trjExpensify
    Contributor

    approved $250 for @mkhutornyi

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

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionDailyKSv2InternalRequires API changes or must be handled by Expensify staff

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions