Skip to content

[$250] "Mark as done" is not shown for "Organize my personal spending' #93369

Closed

Description

@applause-bot

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.4.6-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #92254
Email or phone of affected tester (no customers): gibethlehem@gmail.com
Issue reported by: Applause Internal Team
Bug source: Pull Request QA execution
Device used: macOS/chrome
App Component: Chat Report View

Action Performed:

  1. Navigate to https://staging.new.expensify.com/
  2. Create a new account and select "Organize my personal spending" during onboarding
  3. Create an expense in the workspace chat

Expected Result:

the Submit CTA says "Mark as done"

Actual Result:

the Submit CTA says "pay"

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7178437_1781225650312.Screen_Recording_2026-06-12_at_3.39.53_at_night.mp4

View all open jobs on GitHub

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

Upwork Automation - Do Not Edit

Activity

  1. applause-bot commented on Jun 12, 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/f6c09c31976b720409a1cea2f382287057334e3a9c06ef19319904bd743b4a5d

  2. added
    Daily
    Bug
    on Jun 12, 2026
  3. MelvinBot commented on Jun 12, 2026

    @MelvinBot
    Contributor

    Proposal

    Root Cause

    The "Mark as done" copy from PR #92254 is only wired into the Submit and Approve primary-action buttons. For the Organize my personal spending flow the report's primary action resolves to Pay, and the Pay button was never given the "Mark as done" copy — so it shows "pay".

    Two things combine to produce this:

    1. The Pay button has no track-intent copy. Only SubmitPrimaryAction.tsx:126 and ApprovePrimaryAction.tsx:41 check shouldUseMarkAsDoneCopy. PayPrimaryAction.tsx and the preview's PayActionButton.tsx have no equivalent.

    2. The primary action falls through to Pay. In getReportPrimaryAction, Submit is checked before Pay, but isSubmitAction requires the report to still be Open (ReportPrimaryActionUtils.ts:153). The expense is auto-submitted on creation, so the report is no longer Open → Submit is skipped and Pay wins.

    The gate itself also excludes this case: shouldShowMarkAsDone requires isSubmitAndClose(policy) (= approvalMode === OPTIONAL, PolicyUtils.ts:1273). A report that offers a Pay action is, by definition, not submit-and-close, so shouldShowMarkAsDone returns false regardless of which button is rendered.

    Why this workspace produces a Pay action (config detail)

    PERSONAL_SPEND ("Organize my personal spending") is a track-onboarding choice (OnboardingUtils.ts:12-14). The App's own optimistic workspace creation sets approvalMode = BASIC for it (via getApprovalModeForNewWorkspace — shouldEnableWorkflowsByDefault is true and the choice isn't TRACK_WORKSPACE) and reimbursementChoice = REIMBURSEMENT_NO (Policy.ts:2645-2648). Neither of those is OPTIONAL approval, so isSubmitAndClose is false. The observed Pay button additionally implies payments are enabled on the staging workspace, which diverges from the optimistic config above — that final policy config is decided by the backend. So whether a Pay action should appear here at all depends on the workspace's backend configuration, which can't be inspected from the App repo.

    Recommended Fix

    Pick based on the intended product behavior for these self-tracking reports:

    • If the report should never offer Pay (the user is just tracking their own spend): the workspace should be submit-and-close with payments disabled so the action stays Submit → "Mark as done". This is a workspace-configuration concern that is decided by the backend (outside the App repo) and should be verified by an internal engineer — the App's optimistic config already sets reimbursementChoice = REIMBURSEMENT_NO, so the staging workspace appears to enable payments anyway.
    • If "Mark as done" should replace "pay" for these users (App-side): apply the track-intent copy to the Pay primary action (PayPrimaryAction.tsx + PayActionButton.tsx) and broaden the gate so a track-intent self-payer report qualifies — shouldShowMarkAsDone currently can't match a payable report because of the isSubmitAndClose requirement.

    I'd recommend confirming the staging workspace's approvalMode/reimbursementChoice first, since that determines which of the two is correct.

    Related


    Next Steps for Contributor+ team:
    To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/93369) to create a draft PR.
    To refine: @MelvinBot <your feedback>
    To reject: Explain why you are rejecting Melvin's proposal.

  4. added
    External
    on Jun 12, 2026
  5. added
    Help Wanted
    on Jun 12, 2026
  6. ahmdshrif commented on Jun 12, 2026

    @ahmdshrif
    Contributor

    Proposal

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

    A user who onboards with "Organize my personal spending" and creates an expense sees a primary CTA labelled "Pay", but for these track-intent users it should read "Mark as done".

    What is the root cause of that problem?

    1. The "Mark as done" copy is gated by shouldShowMarkAsDone(), which returns true exactly for this scenario — a track-intent user (PERSONAL_SPEND/TRACK_WORKSPACE) on a submit-and-close policy who owns the report and is submitting to self.

      App/src/libs/ReportUtils.ts

      Lines 13002 to 13006 in 23e38e8

      function shouldShowMarkAsDone({isTrackIntentUser, report, policy}: {isTrackIntentUser?: boolean; report: OnyxEntry<Report>; policy: OnyxEntry<Policy>}): boolean {
      if (!isTrackIntentUser || !isSubmitAndClose(policy) || !isReportOwner(report)) {
      return false;
      }
      return getNextApproverAccountID(report) === report?.ownerAccountID;

    2. That helper is wired into the Submit CTA (and Approve), swapping common.submit → common.markAsDone:

      const shouldUseMarkAsDoneCopy = shouldShowMarkAsDone({
      policy,
      report: moneyRequestReport,
      isTrackIntentUser,
      });
      const {currentSearchQueryJSON, currentSearchKey} = useSearchQueryContext();
      const {currentSearchResults} = useSearchResultsContext();
      const shouldCalculateTotals = useSearchShouldCalculateTotals(currentSearchKey, currentSearchQueryJSON?.hash, true);
      const handleSubmit = () => {
      if (!moneyRequestReport || shouldBlockSubmit) {
      return;
      }
      if (hasOnlyPendingCardTransactions(transactions)) {
      showPendingCardTransactionsBlockModal(showConfirmModal, translate);
      return;
      }
      confirmPendingRTERAndProceed(() => {
      submitReport({
      expenseReport: moneyRequestReport,
      policy,
      currentUserAccountIDParam: accountID,
      currentUserEmailParam: email ?? '',
      hasViolations,
      isASAPSubmitBetaEnabled,
      expenseReportCurrentNextStepDeprecated: nextStep,
      userBillingGracePeriodEnds,
      amountOwed,
      onSubmitted: startSubmittingAnimation,
      ownerBillingGracePeriodEnd,
      delegateEmail,
      });
      if (currentSearchQueryJSON && !isOffline) {
      search({
      searchKey: currentSearchKey,
      shouldCalculateTotals,
      offset: 0,
      queryJSON: currentSearchQueryJSON,
      isOffline,
      isLoading: !!currentSearchResults?.search?.isLoading,
      });
      }
      });
      };
      return (
      <AnimatedSubmitButton
      success
      text={shouldUseMarkAsDoneCopy ? translate('common.markAsDone') : translate('common.submit')}

    3. But the report here does not resolve to Submit. In a reimbursement-enabled personal workspace the expense auto-advances past OPEN, so isSubmitAction (which requires an open report) is false and getReportPrimaryAction falls through to PAY:

      if (isSubmitAction(report, reportTransactions, reportMetadata, policy, reportNameValuePairs, violations, currentUserLogin, currentUserAccountID)) {
      return CONST.REPORT.PRIMARY_ACTIONS.SUBMIT;
      }
      if (
      isPrimaryPayAction({
      report,
      reportTransactions,
      currentUserAccountID,
      currentUserLogin,
      bankAccountList,
      policy,
      reportNameValuePairs,
      isChatReportArchived,
      invoiceReceiverPolicy,
      reportActions,
      })
      ) {
      return CONST.REPORT.PRIMARY_ACTIONS.PAY;
      }

    4. PayPrimaryAction renders AnimatedSettlementButton and never consults shouldShowMarkAsDone(), so its label stays the default "Pay":

      return (
      <AnimatedSettlementButton
      isPaidAnimationRunning={isPaidAnimationRunning}
      isApprovedAnimationRunning={isApprovedAnimationRunning}
      onAnimationFinish={stopAnimation}
      formattedAmount={totalAmount}
      canIOUBePaid
      onlyShowPayElsewhere={onlyShowPayElsewhere}
      currency={moneyRequestReport?.currency}
      confirmApproval={confirmApproval}
      policyID={moneyRequestReport?.policyID}
      chatReportID={chatReport?.reportID}
      iouReport={moneyRequestReport}
      onPress={confirmPayment}
      enablePaymentsRoute={ROUTES.ENABLE_PAYMENTS}
      shouldHidePaymentOptions={!shouldShowPayButton}
      shouldShowApproveButton={shouldShowApproveButton}
      shouldDisableApproveButton={shouldDisableApproveButton}
      isDisabled={isOffline && !canAllowSettlement}
      isLoading={!isOffline && !canAllowSettlement}
      />

    The relabel covered every CTA except the Pay action — the one this flow actually produces — hence "Pay" instead of "Mark as done".

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

    In PayPrimaryAction, compute the same flag the Submit button uses and pass a "Mark as done" label down to the settlement button when it is set:

    const shouldUseMarkAsDoneCopy = shouldShowMarkAsDone({policy, report: moneyRequestReport, isTrackIntentUser});
    // ...
    <AnimatedSettlementButton
        ...
        customPayButtonText={shouldUseMarkAsDoneCopy ? translate('common.markAsDone') : undefined}
    />

    This mirrors the Submit/Approve pattern and only changes the visible label — payment behaviour, amount and dropdown stay untouched, and non-track-intent users keep "Pay" since the flag is false for them.

    What alternative solutions did you explore? (Optional)

    • Keep these reports on the Submit action (where relabel already works) — rejected: changes report lifecycle/state, far riskier than a copy fix.
    • Relabel inside SettlementButton itself — rejected: it is shared by many non-track-intent flows; gating belongs at the call site.
  7. melvin-bot commented on Jun 12, 2026

    @melvin-bot

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

  8. melvin-bot commented on Jun 12, 2026

    @melvin-bot
  9. changed the title [-]"Mark as done" is not shown for "Organize my personal spending'[/-] [+][$250] "Mark as done" is not shown for "Organize my personal spending'[/+] on Jun 12, 2026
  10. aswin-s commented on Jun 12, 2026

    @aswin-s
    Contributor

    🚫 Duplicated proposal withdrawn by 🤖 ProposalPolice.

  11. MarcosProWork commented on Jun 12, 2026

    @MarcosProWork

    🚫 Duplicated proposal withdrawn by 🤖 ProposalPolice.

  12. github-actions commented on Jun 12, 2026

    @github-actions
    Contributor

    ⚠️ @aswin-s Your proposal is a duplicate of an already existing proposal and has been automatically withdrawn to prevent spam. Please review the existing proposals before submitting a new one.

  13. 21 remaining items

  14. Valforte commented on Jun 12, 2026

    @Valforte
    Contributor

    Confirmed a BE issue, it's a simple fix and I'm working on the PR

  15. removed
    External
    Help Wanted
    on Jun 12, 2026
  16. self-assigned this
    on Jun 12, 2026
  17. Valforte commented on Jun 12, 2026

    @Valforte
    Contributor

    BE PR created

  18. Valforte commented on Jun 15, 2026

    @Valforte
    Contributor

    BE PR is up for review

  19. Valforte commented on Jun 18, 2026

    @Valforte
    Contributor

    Asking for retest

  20. m-natarajan commented on Jun 18, 2026

    @m-natarajan

    Chrome / v9.4.13-0
    Passed

    bandicam.2026-06-18.18-18-34-183.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugDaily

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions