Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3433,7 +3433,11 @@ var require_CONST = __commonJS({
SHIP_CARD: "ship_card",
REPORT_CARD_FRAUD: "report_card_fraud",
ISSUE_CARD: "issue_card",
UPDATE_CARD: "update_card"
UPDATE_CARD: "update_card",
UPDATE_PERSONAL_DETAILS: "update_personal_details",
ADD_DELEGATE: "add_delegate",
UPDATE_DELEGATE: "update_delegate",
CHANGE_PRIMARY_LOGIN: "change_primary_login"
},
EXPENSIFY_CARD: {
FEED_NAME: "Expensify Card",
Expand Down
6 changes: 5 additions & 1 deletion .github/actions/javascript/proposalPoliceComment/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24247,7 +24247,11 @@ var require_CONST = __commonJS({
SHIP_CARD: "ship_card",
REPORT_CARD_FRAUD: "report_card_fraud",
ISSUE_CARD: "issue_card",
UPDATE_CARD: "update_card"
UPDATE_CARD: "update_card",
UPDATE_PERSONAL_DETAILS: "update_personal_details",
ADD_DELEGATE: "add_delegate",
UPDATE_DELEGATE: "update_delegate",
CHANGE_PRIMARY_LOGIN: "change_primary_login"
},
EXPENSIFY_CARD: {
FEED_NAME: "Expensify Card",
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
"date-fns-tz": "^3.2.0",
"dom-serializer": "^0.2.2",
"domhandler": "^5.0.3",
"expensify-common": "2.0.201",
"expensify-common": "2.0.204",
"expo": "57.0.8",
"expo-asset": "57.0.7",
"expo-audio": "57.0.3",
Expand Down
20 changes: 18 additions & 2 deletions src/libs/API/parameters/ResendValidateCodeParams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ type ResendValidateCodeBaseParams = {
// Exclude reasons that require parameters - redefine them as separate types below to enforce their parameters are always passed
reasonCode: Exclude<
ValueOf<typeof CONST.VALIDATE_CODE_REASONS>,
typeof CONST.VALIDATE_CODE_REASONS.REVEAL_CARD_DETAILS | typeof CONST.VALIDATE_CODE_REASONS.REPLACE_CARD | typeof CONST.VALIDATE_CODE_REASONS.REPORT_CARD_FRAUD
| typeof CONST.VALIDATE_CODE_REASONS.REVEAL_CARD_DETAILS
| typeof CONST.VALIDATE_CODE_REASONS.REPLACE_CARD
| typeof CONST.VALIDATE_CODE_REASONS.REPORT_CARD_FRAUD
| typeof CONST.VALIDATE_CODE_REASONS.ADD_DELEGATE
| typeof CONST.VALIDATE_CODE_REASONS.UPDATE_DELEGATE
>;
};

Expand All @@ -32,6 +36,16 @@ type ResendValidateCodeForApproveDigitalWalletParams = {
reasonCardID: number;
};

type ResendValidateCodeForAddDelegateParams = {
reasonCode: typeof CONST.VALIDATE_CODE_REASONS.ADD_DELEGATE;
reasonTargetEmail: string;
};

type ResendValidateCodeForUpdateDelegateParams = {
reasonCode: typeof CONST.VALIDATE_CODE_REASONS.UPDATE_DELEGATE;
reasonTargetEmail: string;
};

// Will be removed eventually
type ResendValidateCodeNotYetImplementedParams = {
reasonCode: null;
Expand All @@ -43,6 +57,8 @@ type ResendValidateCodeParams =
| ResendValidateCodeForRevealCardDetailsParams
| ResendValidateCodeForReplaceCardParams
| ResendValidateCodeForReportCardFraudParams
| ResendValidateCodeForApproveDigitalWalletParams;
| ResendValidateCodeForApproveDigitalWalletParams
| ResendValidateCodeForAddDelegateParams
| ResendValidateCodeForUpdateDelegateParams;

export default ResendValidateCodeParams;
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {isEmptyObject} from '@src/types/utils/EmptyObject';

import type {ValueOf} from 'type-fest';

import {CONST as COMMON_CONST} from 'expensify-common';
import React, {useEffect} from 'react';

type ConfirmDelegateValidateCodePageProps = PlatformStackScreenProps<SettingsNavigatorParamList, typeof SCREENS.SETTINGS.DELEGATE.DELEGATE_CONFIRM_VALIDATE_CODE>;
Expand Down Expand Up @@ -57,7 +58,8 @@ function ConfirmDelegateValidateCodePage({route}: ConfirmDelegateValidateCodePag
onClose={() => Navigation.goBack(ROUTES.SETTINGS_DELEGATE_CONFIRM.getRoute(login, role))}
validateError={validateLoginError}
title={translate('delegate.makeSureItIsYou')}
sendValidateCode={() => requestValidateCodeAction()}
sendValidateCode={() => requestValidateCodeAction({reasonCode: COMMON_CONST.VALIDATE_CODE_REASONS.ADD_DELEGATE, reasonTargetEmail: login})}
validateCodeReasonCode={COMMON_CONST.VALIDATE_CODE_REASONS.ADD_DELEGATE}
handleSubmitForm={(validateCode) => addDelegate({email: login, role, validateCode, delegatedAccess: account?.delegatedAccess})}
descriptionPrimary={translate('delegate.enterSecurityCode', account?.primaryLogin ?? session?.email ?? '')}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {isEmptyObject} from '@src/types/utils/EmptyObject';

import type {ValueOf} from 'type-fest';

import {CONST as COMMON_CONST} from 'expensify-common';
import React, {useEffect} from 'react';

type UpdateDelegateValidateCodePageProps = PlatformStackScreenProps<SettingsNavigatorParamList, typeof SCREENS.SETTINGS.DELEGATE.UPDATE_DELEGATE_ROLE_CONFIRM_VALIDATE_CODE>;
Expand Down Expand Up @@ -54,7 +55,8 @@ function UpdateDelegateValidateCodePage({route}: UpdateDelegateValidateCodePageP
onClose={() => Navigation.goBack(ROUTES.SETTINGS_UPDATE_DELEGATE_ROLE.getRoute(login, currentDelegate?.role ?? ''))}
validateError={updateDelegateErrors}
title={translate('delegate.makeSureItIsYou')}
sendValidateCode={() => requestValidateCodeAction()}
sendValidateCode={() => requestValidateCodeAction({reasonCode: COMMON_CONST.VALIDATE_CODE_REASONS.UPDATE_DELEGATE, reasonTargetEmail: login})}
validateCodeReasonCode={COMMON_CONST.VALIDATE_CODE_REASONS.UPDATE_DELEGATE}
Comment on lines +58 to +59

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Include the target email in resend deduplication

When roles for two different copilot emails are changed within REQUEST_CODE_DELAY, the second screen is treated as the same flow because ValidateCodeActionContent compares only lastValidateCodeReason. It therefore skips this sendValidateCode call even though reasonTargetEmail differs, so no email naming the second copilot is sent and the countdown prevents an immediate resend. Persist and compare the target email as part of the deduplication key; the new add_delegate flow has the same issue.

Useful? React with 👍 / 👎.

handleSubmitForm={(validateCode) => updateDelegateRole({email: login, role: newRole, validateCode, delegatedAccess: account?.delegatedAccess})}
descriptionPrimary={translate('delegate.enterSecurityCode', account?.primaryLogin ?? session?.email ?? '')}
/>
Expand Down
Loading