From dfb1b4a99a86fb244a655e0034546dc4e32e9080 Mon Sep 17 00:00:00 2001 From: Jules Date: Fri, 18 Sep 2026 11:07:18 -0700 Subject: [PATCH] =?UTF-8?q?Revert=20"=F0=9F=8D=92=20Cherry=20pick=20PR=20#?= =?UTF-8?q?101459=20to=20production=20=F0=9F=8D=92"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Mobile-Expensify | 2 +- android/app/build.gradle | 4 ++-- ios/NewExpensify/Info.plist | 4 ++-- ios/NotificationServiceExtension/Info.plist | 4 ++-- ios/ShareViewController/Info.plist | 4 ++-- package-lock.json | 4 ++-- package.json | 2 +- .../ProductMarketingWindowManager.tsx | 2 +- .../ReportActionItem/MoneyRequestView.tsx | 2 +- src/libs/PolicyUtils.ts | 11 +++++---- .../iou/request/step/IOURequestStepVendor.tsx | 3 +-- .../WorkspaceMoreFeaturesPage/index.tsx | 10 ++++---- .../rules/MerchantRules/AddVendorPage.tsx | 3 +-- .../MerchantRules/MerchantRulePageBase.tsx | 3 +-- .../vendors/WorkspaceVendorsPage.tsx | 3 +-- tests/ui/WorkspaceMoreFeaturesPageTest.tsx | 4 ++-- tests/unit/PolicyUtilsTest.ts | 5 ++-- tests/unit/ProductMarketingWindowTest.tsx | 24 +++---------------- 18 files changed, 37 insertions(+), 57 deletions(-) diff --git a/Mobile-Expensify b/Mobile-Expensify index b27c7d2ea2da..c23a0ee55f00 160000 --- a/Mobile-Expensify +++ b/Mobile-Expensify @@ -1 +1 @@ -Subproject commit b27c7d2ea2da21c134e95ef9c3315d79d526b101 +Subproject commit c23a0ee55f00c27f44b392a147bc4779236147b9 diff --git a/android/app/build.gradle b/android/app/build.gradle index 6725d148a613..520652b6ef57 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -111,8 +111,8 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion multiDexEnabled rootProject.ext.multiDexEnabled - versionCode 1009048500 - versionName "9.4.85-0" + versionCode 1009048101 + versionName "9.4.81-1" // Supported language variants must be declared here to avoid from being removed during the compilation. // This also helps us to not include unnecessary language variants in the APK. resConfigs "en", "es" diff --git a/ios/NewExpensify/Info.plist b/ios/NewExpensify/Info.plist index 43b4f2501c23..5332ee65b7b6 100644 --- a/ios/NewExpensify/Info.plist +++ b/ios/NewExpensify/Info.plist @@ -23,7 +23,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 9.4.85 + 9.4.81 CFBundleSignature ???? CFBundleURLTypes @@ -44,7 +44,7 @@ CFBundleVersion - 9.4.85.0 + 9.4.81.1 FullStory OrgId diff --git a/ios/NotificationServiceExtension/Info.plist b/ios/NotificationServiceExtension/Info.plist index 2ca8b039f277..1c0776a0c39a 100644 --- a/ios/NotificationServiceExtension/Info.plist +++ b/ios/NotificationServiceExtension/Info.plist @@ -11,9 +11,9 @@ CFBundleName $(PRODUCT_NAME) CFBundleShortVersionString - 9.4.85 + 9.4.81 CFBundleVersion - 9.4.85.0 + 9.4.81.1 NSExtension NSExtensionPointIdentifier diff --git a/ios/ShareViewController/Info.plist b/ios/ShareViewController/Info.plist index 8434e49ae700..5107ea46c130 100644 --- a/ios/ShareViewController/Info.plist +++ b/ios/ShareViewController/Info.plist @@ -11,9 +11,9 @@ CFBundleName $(PRODUCT_NAME) CFBundleShortVersionString - 9.4.85 + 9.4.81 CFBundleVersion - 9.4.85.0 + 9.4.81.1 NSExtension NSExtensionAttributes diff --git a/package-lock.json b/package-lock.json index d9738a07bc7b..1dfc95e44991 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "new.expensify", - "version": "9.4.85-0", + "version": "9.4.81-1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "new.expensify", - "version": "9.4.85-0", + "version": "9.4.81-1", "hasInstallScript": true, "license": "MIT", "workspaces": [ diff --git a/package.json b/package.json index ade889fd3318..8ab12eaf549e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "new.expensify", - "version": "9.4.85-0", + "version": "9.4.81-1", "author": "Expensify, Inc.", "homepage": "https://new.expensify.com", "description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.", diff --git a/src/components/ProductMarketingWindow/ProductMarketingWindowManager.tsx b/src/components/ProductMarketingWindow/ProductMarketingWindowManager.tsx index 3f43a42f56d3..36a494480114 100644 --- a/src/components/ProductMarketingWindow/ProductMarketingWindowManager.tsx +++ b/src/components/ProductMarketingWindow/ProductMarketingWindowManager.tsx @@ -92,7 +92,7 @@ function ProductMarketingWindowManager({topmostRouteName}: ProductMarketingWindo const illustrations = useMemoizedLazyIllustrations(illustrationNames); const variant = getProductMarketingAnnouncementVariant(announcement, !!targetAdminPolicyID, lastDismissedMarketingWindow); const isVendorMatchingBetaEnabled = isBetaEnabled(CONST.BETAS.VENDOR_MATCHING); - const shouldPrefetchTargetPolicyConnections = !!targetAdminPolicyID && targetAdminPolicyID !== activePolicyID; + const shouldPrefetchTargetPolicyConnections = isVendorMatchingBetaEnabled && !!targetAdminPolicyID && targetAdminPolicyID !== activePolicyID; const {isFetchNeeded, isLoadingFetchedFlag, hasBeenFetched} = usePolicyConnectionsPrefetch(targetAdminPolicy, shouldPrefetchTargetPolicyConnections); const isAdminCtaPending = shouldPrefetchTargetPolicyConnections && (isLoadingFetchedFlag || (isFetchNeeded && hasBeenFetched === undefined)); const isAdminPolicyConnectionDataAvailable = !shouldPrefetchTargetPolicyConnections || hasBeenFetched === true; diff --git a/src/components/ReportActionItem/MoneyRequestView.tsx b/src/components/ReportActionItem/MoneyRequestView.tsx index 014822725c13..077faf6ee2c7 100644 --- a/src/components/ReportActionItem/MoneyRequestView.tsx +++ b/src/components/ReportActionItem/MoneyRequestView.tsx @@ -566,7 +566,7 @@ function MoneyRequestView({ } else if (transactionVendor?.externalID) { transactionVendorName = transactionVendor.externalID; } - const shouldShowVendor = hasVendorFeature(policy, isVendorMatchingBetaEnabled ?? false) && !(updatedTransaction?.reimbursable ?? !!transactionReimbursable) && !isInvoice; + const shouldShowVendor = hasVendorFeature(policy, isBetaEnabled(CONST.BETAS.VENDOR_MATCHING)) && !(updatedTransaction?.reimbursable ?? !!transactionReimbursable) && !isInvoice; const vendorFieldLabel = isXeroActiveMatchingSource(policy) ? translate('common.supplier') : translate('common.vendor'); const transactionTripID = transaction?.comment?.tripID; diff --git a/src/libs/PolicyUtils.ts b/src/libs/PolicyUtils.ts index 560848e71397..36f241122432 100644 --- a/src/libs/PolicyUtils.ts +++ b/src/libs/PolicyUtils.ts @@ -2705,21 +2705,24 @@ function isXeroActiveMatchingSource(policy: OnyxEntry): boolean { * the field. * * The `vendorMatching` beta only gates the integrations that haven't reached GA yet, so - * `isVendorMatchingBetaEnabled` is consulted on the Intacct, Xero and Rillet branches but not on QBO or DualEntry: + * `isVendorMatchingBetaEnabled` is consulted on the Intacct, Xero, Rillet, and DualEntry branches but not on QBO: * - QBO (R1) with non-reimbursable export = Credit Card or Debit Card. GA, so no beta required * - Sage Intacct (R2) with non-reimbursable export = Credit Card Charge. Beta required * - Xero (R3) has no export destination enum, so a configured connection is enough. Beta required * - Rillet (R4) configured connection. Beta required - * - DualEntry configured connection. GA, so no beta required + * - DualEntry configured connection. Beta required */ function hasVendorFeature(policy: OnyxEntry, isVendorMatchingBetaEnabled: boolean): boolean { if (!policy) { return false; } - if (isQBOVendorMatchingActive(policy) || isDualEntryVendorMatchingActive(policy)) { + if (isQBOVendorMatchingActive(policy)) { return true; } - return isVendorMatchingBetaEnabled && (isIntacctVendorMatchingActive(policy) || isXeroVendorMatchingActive(policy) || isRilletVendorMatchingActive(policy)); + return ( + isVendorMatchingBetaEnabled && + (isIntacctVendorMatchingActive(policy) || isXeroVendorMatchingActive(policy) || isRilletVendorMatchingActive(policy) || isDualEntryVendorMatchingActive(policy)) + ); } /** diff --git a/src/pages/iou/request/step/IOURequestStepVendor.tsx b/src/pages/iou/request/step/IOURequestStepVendor.tsx index af98674fe953..49a6a2dda1f5 100644 --- a/src/pages/iou/request/step/IOURequestStepVendor.tsx +++ b/src/pages/iou/request/step/IOURequestStepVendor.tsx @@ -63,8 +63,7 @@ function IOURequestStepVendor({ const [transactionViolations] = useOnyx(`${ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS}${getNonEmptyStringOnyxID(transactionID)}`); const delegateAccountID = useDelegateAccountID(); - const isVendorMatchingBetaEnabled = isBetaEnabled(CONST.BETAS.VENDOR_MATCHING); - const isFeatureAvailable = hasVendorFeature(policy, isVendorMatchingBetaEnabled); + const isFeatureAvailable = hasVendorFeature(policy, isBetaEnabled(CONST.BETAS.VENDOR_MATCHING)); const isOnXero = isXeroActiveMatchingSource(policy); const emptyState = getVendorEmptyState(policy, translate); diff --git a/src/pages/workspace/WorkspaceMoreFeaturesPage/index.tsx b/src/pages/workspace/WorkspaceMoreFeaturesPage/index.tsx index 7ef93f3bc675..ff1c8965f7ad 100644 --- a/src/pages/workspace/WorkspaceMoreFeaturesPage/index.tsx +++ b/src/pages/workspace/WorkspaceMoreFeaturesPage/index.tsx @@ -164,15 +164,16 @@ function WorkspaceMoreFeaturesPage({policy, route}: WorkspaceMoreFeaturesPagePro // connection, and when the data has already been fetched. usePolicyConnectionsPrefetch(policy, true); - // Visibility is gated on a supported integration (QBO / Xero / Sage Intacct / DualEntry) being connected, + // Visibility is gated on a supported integration (QBO / Xero / Sage Intacct) being connected, // not on the export config actually scoping vendors. That way members on a supported workspace // still see the row so they can discover the feature even when the row is locked OFF (export // config not yet set). NetSuite / QuickBooks Desktop / no connection hide the row. // `hasVendorFeature` stays as the narrower `isActive` predicate (is the export config scoping // vendors right now), so it can't double as the visibility gate. // - // When no source is active, keep the connected integration's discovery row. - // QBO (R1) and DualEntry are GA. Xero, Sage Intacct, and Rillet require the vendorMatching beta. + // Use the active vendor source so a stale QBO connection cannot bypass the beta for another + // integration. When no source is active, keep the connected integration's discovery row. + // QBO (R1) is GA. Sage Intacct, Xero, Rillet, and DualEntry require the vendorMatching beta. const vendorMatchingConnection = getActiveVendorMatchingIntegration(policy) ?? getConnectedIntegration(policy, [ @@ -182,8 +183,7 @@ function WorkspaceMoreFeaturesPage({policy, route}: WorkspaceMoreFeaturesPagePro CONST.POLICY.CONNECTIONS.NAME.RILLET, CONST.POLICY.CONNECTIONS.NAME.DUALENTRY, ]); - const isGenerallyAvailableVendorConnection = vendorMatchingConnection === CONST.POLICY.CONNECTIONS.NAME.QBO || vendorMatchingConnection === CONST.POLICY.CONNECTIONS.NAME.DUALENTRY; - const shouldShowVendorsFeature = isGenerallyAvailableVendorConnection || (isVendorMatchingEnabled && !!vendorMatchingConnection); + const shouldShowVendorsFeature = vendorMatchingConnection === CONST.POLICY.CONNECTIONS.NAME.QBO || (isVendorMatchingEnabled && !!vendorMatchingConnection); const warnAccountingManagesOrganizeFeature = async () => { if (!hasAccountingConnection || !policyID) { diff --git a/src/pages/workspace/rules/MerchantRules/AddVendorPage.tsx b/src/pages/workspace/rules/MerchantRules/AddVendorPage.tsx index a770b78f6226..7a4aed29aa8a 100644 --- a/src/pages/workspace/rules/MerchantRules/AddVendorPage.tsx +++ b/src/pages/workspace/rules/MerchantRules/AddVendorPage.tsx @@ -62,7 +62,6 @@ function AddVendorPage({route}: AddVendorPageProps) { // connection, and when the data has already been fetched. const {isFetchNeeded, isLoadingFetchedFlag} = usePolicyConnectionsPrefetch(policy, true); - const isVendorMatchingBetaEnabled = isBetaEnabled(CONST.BETAS.VENDOR_MATCHING); const isOnXero = isXeroActiveMatchingSource(policy); const unavailableLabel = translate(isOnXero ? 'workspace.rules.merchantRules.supplierUnavailable' : 'workspace.rules.merchantRules.vendorUnavailable'); const selectedVendorItem = getSelectedVendorItem(policy, form?.vendorID, unavailableLabel); @@ -82,7 +81,7 @@ function AddVendorPage({route}: AddVendorPageProps) { // Gate direct/deeplink access behind the same predicate that hides the "Set vendor to" row, so the beta can't be // bypassed by opening this picker's URL directly (which would otherwise write vendorID into the draft and save it). - if (!hasVendorFeature(policy, isVendorMatchingBetaEnabled)) { + if (!hasVendorFeature(policy, isBetaEnabled(CONST.BETAS.VENDOR_MATCHING))) { return ; } diff --git a/src/pages/workspace/rules/MerchantRules/MerchantRulePageBase.tsx b/src/pages/workspace/rules/MerchantRules/MerchantRulePageBase.tsx index c334ae9f942a..510fa32d8415 100644 --- a/src/pages/workspace/rules/MerchantRules/MerchantRulePageBase.tsx +++ b/src/pages/workspace/rules/MerchantRules/MerchantRulePageBase.tsx @@ -266,8 +266,7 @@ function MerchantRulePageBase({policyID, ruleID, initialCategoryName, editCatego const isBillableEnabled = policy?.disabledFields?.defaultBillable !== true; - const isVendorMatchingBetaEnabled = isBetaEnabled(CONST.BETAS.VENDOR_MATCHING); - const isVendorFeatureEnabled = hasVendorFeature(policy, isVendorMatchingBetaEnabled); + const isVendorFeatureEnabled = hasVendorFeature(policy, isBetaEnabled(CONST.BETAS.VENDOR_MATCHING)); const isOnXero = isXeroActiveMatchingSource(policy); const vendorFieldLabel = translate(isOnXero ? 'common.supplier' : 'common.vendor'); const unavailableLabel = translate(isOnXero ? 'workspace.rules.merchantRules.supplierUnavailable' : 'workspace.rules.merchantRules.vendorUnavailable'); diff --git a/src/pages/workspace/vendors/WorkspaceVendorsPage.tsx b/src/pages/workspace/vendors/WorkspaceVendorsPage.tsx index 921a25fca47a..074ce4988cf3 100644 --- a/src/pages/workspace/vendors/WorkspaceVendorsPage.tsx +++ b/src/pages/workspace/vendors/WorkspaceVendorsPage.tsx @@ -36,8 +36,7 @@ function WorkspaceVendorsPage({policy, route}: WorkspaceVendorsPageProps) { useWorkspaceDocumentTitle(policy?.name, 'workspace.common.vendors'); - const isVendorMatchingBetaEnabled = isBetaEnabled(CONST.BETAS.VENDOR_MATCHING); - const isFeatureAvailable = hasVendorFeature(policy, isVendorMatchingBetaEnabled); + const isFeatureAvailable = hasVendorFeature(policy, isBetaEnabled(CONST.BETAS.VENDOR_MATCHING)); const vendors = getMatchingVendors(policy); const sortedVendors = sortVendors(vendors, localeCompare); const connectedIntegration = getActiveVendorMatchingIntegration(policy); diff --git a/tests/ui/WorkspaceMoreFeaturesPageTest.tsx b/tests/ui/WorkspaceMoreFeaturesPageTest.tsx index 0a71b245d79f..5802a28d4f4b 100644 --- a/tests/ui/WorkspaceMoreFeaturesPageTest.tsx +++ b/tests/ui/WorkspaceMoreFeaturesPageTest.tsx @@ -468,7 +468,7 @@ describe('WorkspaceMoreFeaturesPage', () => { }); it.each([ - {isBetaEnabled: false, qboDestination: CONST.QUICKBOOKS_NON_REIMBURSABLE_EXPORT_ACCOUNT_TYPE.VENDOR_BILL, shouldShowVendors: true}, + {isBetaEnabled: false, qboDestination: CONST.QUICKBOOKS_NON_REIMBURSABLE_EXPORT_ACCOUNT_TYPE.VENDOR_BILL, shouldShowVendors: false}, {isBetaEnabled: true, qboDestination: CONST.QUICKBOOKS_NON_REIMBURSABLE_EXPORT_ACCOUNT_TYPE.VENDOR_BILL, shouldShowVendors: true}, {isBetaEnabled: false, qboDestination: CONST.QUICKBOOKS_NON_REIMBURSABLE_EXPORT_ACCOUNT_TYPE.CREDIT_CARD, shouldShowVendors: true}, ])( @@ -483,7 +483,7 @@ describe('WorkspaceMoreFeaturesPage', () => { // When the More features page renders with the selected beta state await renderWithVendorMatching(connections, isBetaEnabled); - // Then visibility follows DualEntry's GA availability when it scopes vendors. + // Then visibility follows the active vendor source's beta requirement if (shouldShowVendors) { await expect(findLockedSwitch('workspace.moreFeatures.vendors.subtitle')).resolves.toBeOnTheScreen(); } else { diff --git a/tests/unit/PolicyUtilsTest.ts b/tests/unit/PolicyUtilsTest.ts index 5418017dd211..ee9ccad7691d 100644 --- a/tests/unit/PolicyUtilsTest.ts +++ b/tests/unit/PolicyUtilsTest.ts @@ -4283,13 +4283,12 @@ describe('PolicyUtils', () => { }, }); - it('requires a configured connection but not the matching beta', () => { + it('requires a configured connection and the matching beta', () => { const policy = buildDualEntryPolicy(vendors); expect(isDualEntryVendorMatchingActive(policy)).toBe(true); expect(hasVendorFeature(policy, true)).toBe(true); - expect(hasVendorFeature(policy, false)).toBe(true); + expect(hasVendorFeature(policy, false)).toBe(false); expect(hasVendorFeature(buildDualEntryPolicy(vendors, false), true)).toBe(false); - expect(hasVendorFeature(buildDualEntryPolicy(vendors, false), false)).toBe(false); expect(isDualEntryVendorMatchingActive(undefined)).toBe(false); }); diff --git a/tests/unit/ProductMarketingWindowTest.tsx b/tests/unit/ProductMarketingWindowTest.tsx index 59a62ec6e741..d9576b3adc7f 100644 --- a/tests/unit/ProductMarketingWindowTest.tsx +++ b/tests/unit/ProductMarketingWindowTest.tsx @@ -836,7 +836,7 @@ describe('ProductMarketingWindowManager', () => { expect(mockNavigate).toHaveBeenCalledWith(ROUTES.WORKSPACE_VENDORS.getRoute(POLICY_ID)); }); - it('waits for fallback workspace connections, then uses the hydrated DualEntry Vendors route when Vendor Matching beta is disabled', async () => { + it('uses More Features without fetching fallback workspace connections when Vendor Matching beta is disabled', async () => { await act(async () => { await setupOnyxBaseline({ isAdmin: true, @@ -852,30 +852,12 @@ describe('ProductMarketingWindowManager', () => { renderManager(); await waitForBatchedUpdatesWithAct(); - expect(mockOpenPolicyAccountingPage).toHaveBeenCalledWith(POLICY_ID); - expect(screen.getByText(adminCtaLabel)).toBeDisabled(); - fireEvent.press(screen.getByText(adminCtaLabel)); - await waitForBatchedUpdatesWithAct(); - - expect(mockNavigate).not.toHaveBeenCalled(); - - await act(async () => { - await Onyx.set(`${ONYXKEYS.COLLECTION.POLICY}${POLICY_ID}`, { - ...buildAdminPolicy(), - areConnectionsEnabled: true, - connections: createMock({ - [CONST.POLICY.CONNECTIONS.NAME.DUALENTRY]: {config: {isConfigured: true}}, - }), - }); - await Onyx.set(`${ONYXKEYS.COLLECTION.POLICY_HAS_CONNECTIONS_DATA_BEEN_FETCHED}${POLICY_ID}`, true); - await waitForBatchedUpdatesWithAct(); - }); - + expect(mockOpenPolicyAccountingPage).not.toHaveBeenCalled(); expect(screen.getByText(adminCtaLabel)).not.toBeDisabled(); fireEvent.press(screen.getByText(adminCtaLabel)); await waitForBatchedUpdatesWithAct(); - expect(mockNavigate).toHaveBeenCalledWith(ROUTES.WORKSPACE_VENDORS.getRoute(POLICY_ID)); + expect(mockNavigate).toHaveBeenCalledWith(ROUTES.WORKSPACE_MORE_FEATURES.getRoute(POLICY_ID)); }); it.each([