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
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 @@ -188,7 +188,7 @@
"react-native-localize": "^3.5.4",
"react-native-nitro-modules": "0.29.4",
"react-native-nitro-sqlite": "9.1.11",
"react-native-onyx": "3.0.8",
"react-native-onyx": "3.0.13",
"react-native-pager-view": "6.9.1",
"react-native-pdf": "7.0.2",
"react-native-performance": "^5.1.4",
Expand Down
1 change: 1 addition & 0 deletions src/libs/Network/SequentialQueue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ Onyx.connectWithoutView({
});

function saveQueueFlushedData(...onyxUpdates: OnyxUpdate[]) {
// @ts-expect-error - will be solved in https://github.com/Expensify/App/issues/73830
const newValue = [...queueFlushedDataToStore, ...onyxUpdates];
// eslint-disable-next-line rulesdir/prefer-actions-set-data
return Onyx.set(ONYXKEYS.QUEUE_FLUSHED_DATA, newValue).then(() => {
Expand Down
3 changes: 3 additions & 0 deletions src/libs/OptimisticReportNames.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ function updateOptimisticReportNamesFromUpdates(updates: OnyxUpdate[], context:
const reportNameUpdate = computeReportNameIfNeeded(report, update, context);

if (reportNameUpdate) {
// @ts-expect-error - will be solved in https://github.com/Expensify/App/issues/73830
additionalUpdates.push({
key: getReportKey(reportID),
onyxMethod: Onyx.METHOD.MERGE,
Expand All @@ -321,6 +322,7 @@ function updateOptimisticReportNamesFromUpdates(updates: OnyxUpdate[], context:
const reportNameUpdate = computeReportNameIfNeeded(report, update, context);

if (reportNameUpdate) {
// @ts-expect-error - will be solved in https://github.com/Expensify/App/issues/73830
additionalUpdates.push({
key: getReportKey(report.reportID),
onyxMethod: Onyx.METHOD.MERGE,
Expand All @@ -346,6 +348,7 @@ function updateOptimisticReportNamesFromUpdates(updates: OnyxUpdate[], context:
const reportNameUpdate = computeReportNameIfNeeded(report, update, context);

if (reportNameUpdate) {
// @ts-expect-error - will be solved in https://github.com/Expensify/App/issues/73830
additionalUpdates.push({
key: getReportKey(report.reportID),
onyxMethod: Onyx.METHOD.MERGE,
Expand Down
1 change: 1 addition & 0 deletions src/libs/actions/Card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ type IssueNewCardFlowData = {
function reportVirtualExpensifyCardFraud(card: Card, validateCode: string) {
const cardID = card?.cardID ?? CONST.DEFAULT_NUMBER_ID;
const optimisticData: OnyxUpdate[] = [
// @ts-expect-error - will be solved in https://github.com/Expensify/App/issues/73830
{
onyxMethod: Onyx.METHOD.MERGE,
key: ONYXKEYS.FORMS.REPORT_VIRTUAL_CARD_FRAUD,
Expand Down
2 changes: 2 additions & 0 deletions src/libs/actions/CompanyCards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ function addNewCompanyCardsFeed(
const feedType = CardUtils.getFeedType(cardFeed, cardFeeds);

const optimisticData: OnyxUpdate[] = [
// @ts-expect-error - will be solved in https://github.com/Expensify/App/issues/73830
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.LAST_SELECTED_FEED}${policyID}`,
Expand Down Expand Up @@ -121,6 +122,7 @@ function addNewCompanyCardsFeed(
];

const successData: OnyxUpdate[] = [
// @ts-expect-error - will be solved in https://github.com/Expensify/App/issues/73830
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.LAST_SELECTED_FEED}${policyID}`,
Expand Down
25 changes: 25 additions & 0 deletions src/libs/actions/IOU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1808,6 +1808,7 @@ function buildOnyxDataForMoneyRequest(moneyRequestParams: BuildOnyxDataForMoneyR
});

optimisticData.push(
// @ts-expect-error - will be solved in https://github.com/Expensify/App/issues/73830
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.NVP_DISMISSED_PRODUCT_TRAINING}`,
Expand Down Expand Up @@ -4628,6 +4629,7 @@ function getUpdateMoneyRequestParams(params: GetUpdateMoneyRequestParamsType): U
optimisticData.push({
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS}${transactionID}`,
// @ts-expect-error - will be solved in https://github.com/Expensify/App/issues/73830
value: violations?.filter((violation) => violation.name !== 'overLimit') ?? [],
});
}
Expand Down Expand Up @@ -4727,6 +4729,7 @@ function getUpdateMoneyRequestParams(params: GetUpdateMoneyRequestParamsType): U
value: currentTransactionViolations,
});
if (hash) {
// @ts-expect-error - will be solved in https://github.com/Expensify/App/issues/73830
optimisticData.push({
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.SNAPSHOT}${hash}`,
Expand All @@ -4736,6 +4739,7 @@ function getUpdateMoneyRequestParams(params: GetUpdateMoneyRequestParamsType): U
},
},
});
// @ts-expect-error - will be solved in https://github.com/Expensify/App/issues/73830
failureData.push({
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.SNAPSHOT}${hash}`,
Expand Down Expand Up @@ -6636,6 +6640,7 @@ function trackExpense(params: CreateTrackExpenseParams) {
});

if (isMapDistanceRequest(transaction) || isManualDistanceRequestTransactionUtils(transaction)) {
// @ts-expect-error - will be solved in https://github.com/Expensify/App/issues/73830
onyxData?.optimisticData?.push({
onyxMethod: Onyx.METHOD.SET,
key: ONYXKEYS.NVP_LAST_DISTANCE_EXPENSE_TYPE,
Expand Down Expand Up @@ -8328,6 +8333,7 @@ function createDistanceRequest(distanceRequestInformation: CreateDistanceRequest
onyxData = moneyRequestOnyxData;

if (transaction.iouRequestType === CONST.IOU.REQUEST_TYPE.DISTANCE_MAP || isManualDistanceRequest) {
// @ts-expect-error - will be solved in https://github.com/Expensify/App/issues/73830
onyxData?.optimisticData?.push({
onyxMethod: Onyx.METHOD.SET,
key: ONYXKEYS.NVP_LAST_DISTANCE_EXPENSE_TYPE,
Expand Down Expand Up @@ -8791,6 +8797,7 @@ function cleanUpMoneyRequest(
value: updatedReportAction,
});
onyxUpdates.push(
// @ts-expect-error - will be solved in https://github.com/Expensify/App/issues/73830
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT}${iouReport?.reportID}`,
Expand Down Expand Up @@ -8959,6 +8966,7 @@ function deleteMoneyRequest(
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${iouReport?.reportID}`,
value: updatedReportAction,
},
// @ts-expect-error - will be solved in https://github.com/Expensify/App/issues/73830
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT}${iouReport?.reportID}`,
Expand Down Expand Up @@ -9107,6 +9115,7 @@ function deleteMoneyRequest(
},
},
},
// @ts-expect-error - will be solved in https://github.com/Expensify/App/issues/73830
shouldDeleteIOUReport
? {
onyxMethod: Onyx.METHOD.SET,
Expand Down Expand Up @@ -9570,6 +9579,8 @@ function getSendMoneyParams(
});
}

// @ts-expect-error - will be solved in https://github.com/Expensify/App/issues/73830
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const optimisticData: OnyxUpdate[] = [
optimisticChatReportData,
optimisticQuickActionData,
Expand Down Expand Up @@ -10506,6 +10517,8 @@ function approveMoneyRequest(
key: `${ONYXKEYS.COLLECTION.NEXT_STEP}${expenseReport.reportID}`,
value: optimisticNextStep,
};
// @ts-expect-error - will be solved in https://github.com/Expensify/App/issues/73830
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const optimisticData: OnyxUpdate[] = [optimisticIOUReportData, optimisticReportActionsData, optimisticNextStepData, ...(optimisticChatReportData ? [optimisticChatReportData] : [])];

const successData: OnyxUpdate[] = [
Expand Down Expand Up @@ -10877,6 +10890,7 @@ function retractReport(
},
},
},
// @ts-expect-error - will be solved in https://github.com/Expensify/App/issues/73830
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT}${expenseReport.reportID}`,
Expand Down Expand Up @@ -11741,6 +11755,7 @@ function replaceReceipt({transactionID, file, source, transactionPolicyCategorie
});
}
if (currentSearchQueryJSON?.hash) {
// @ts-expect-error - will be solved in https://github.com/Expensify/App/issues/73830
optimisticData.push({
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.SNAPSHOT}${currentSearchQueryJSON.hash}`,
Expand All @@ -11754,6 +11769,7 @@ function replaceReceipt({transactionID, file, source, transactionPolicyCategorie
},
});

// @ts-expect-error - will be solved in https://github.com/Expensify/App/issues/73830
failureData.push({
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.SNAPSHOT}${currentSearchQueryJSON.hash}`,
Expand Down Expand Up @@ -12212,6 +12228,7 @@ function unholdRequest(transactionID: string, reportID: string) {
{
onyxMethod: Onyx.METHOD.SET,
key: `${ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS}${transactionID}`,
// @ts-expect-error - will be solved in https://github.com/Expensify/App/issues/73830
value: transactionViolations?.filter((violation) => violation.name !== CONST.VIOLATIONS.HOLD) ?? [],
},
{
Expand Down Expand Up @@ -12435,6 +12452,7 @@ function mergeDuplicates({transactionThreadReportID: optimisticTransactionThread
return {
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS}${id}`,
// @ts-expect-error - will be solved in https://github.com/Expensify/App/issues/73830
value: violations.filter((violation) => violation.name !== CONST.VIOLATIONS.DUPLICATED_TRANSACTION),
};
});
Expand Down Expand Up @@ -12683,6 +12701,7 @@ function resolveDuplicates(params: MergeDuplicatesParams) {
return {
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS}${id}`,
// @ts-expect-error - will be solved in https://github.com/Expensify/App/issues/73830
value: updatedViolations.filter((violation) => violation.name !== CONST.VIOLATIONS.DUPLICATED_TRANSACTION),
};
});
Expand Down Expand Up @@ -12900,6 +12919,7 @@ function getSearchOnyxUpdate({
}
return {
optimisticData: [
// @ts-expect-error - will be solved in https://github.com/Expensify/App/issues/73830
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.SNAPSHOT}${currentSearchQueryJSON.hash}` as const,
Expand Down Expand Up @@ -13307,6 +13327,7 @@ function rejectMoneyRequest(transactionID: string, reportID: string, comment: st
onyxMethod: Onyx.METHOD.SET,
key: `${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${rejectedToReportID}`,
value: {
// @ts-expect-error - will be solved in https://github.com/Expensify/App/issues/73830
parentReportID: report?.chatReportID,
},
},
Expand Down Expand Up @@ -13647,6 +13668,7 @@ function markRejectViolationAsResolved(transactionID: string, reportID?: string)

// Build optimistic data
const optimisticData: OnyxUpdate[] = [
// @ts-expect-error - will be solved in https://github.com/Expensify/App/issues/73830
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS}${transactionID}`,
Expand Down Expand Up @@ -13674,6 +13696,7 @@ function markRejectViolationAsResolved(transactionID: string, reportID?: string)
];

const failureData: OnyxUpdate[] = [
// @ts-expect-error - will be solved in https://github.com/Expensify/App/issues/73830
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS}${transactionID}`,
Expand Down Expand Up @@ -14210,6 +14233,7 @@ function updateSplitTransactions({
},
});

// @ts-expect-error - will be solved in https://github.com/Expensify/App/issues/73830
failureData.push({
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.TRANSACTION}${originalTransactionID}`,
Expand Down Expand Up @@ -14256,6 +14280,7 @@ function updateSplitTransactions({
},
});

// @ts-expect-error - will be solved in https://github.com/Expensify/App/issues/73830
failureData.push({
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.SNAPSHOT}${hash}`,
Expand Down
11 changes: 10 additions & 1 deletion src/libs/actions/MergeTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ function mergeTransactionRequest({
]
: [];

// @ts-expect-error - will be solved in https://github.com/Expensify/App/issues/73830
const failureSourceReportData: OnyxUpdate[] =
transactionsOfSourceReport.length === 1
? [
Expand Down Expand Up @@ -352,6 +353,7 @@ function mergeTransactionRequest({
return {
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS}${id}`,
// @ts-expect-error - will be solved in https://github.com/Expensify/App/issues/73830
value: violations.filter((violation) => violation.name !== CONST.VIOLATIONS.DUPLICATED_TRANSACTION),
};
});
Expand All @@ -365,6 +367,8 @@ function mergeTransactionRequest({
};
});

// @ts-expect-error - will be solved in https://github.com/Expensify/App/issues/73830
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const optimisticData: OnyxUpdate[] = [
...(onyxTargetTransactionData.optimisticData ?? []),
optimisticSourceTransactionData,
Expand All @@ -374,14 +378,19 @@ function mergeTransactionRequest({
...optimisticSourceReportActionData,
];

// @ts-expect-error - will be solved in https://github.com/Expensify/App/issues/73830
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const failureData: OnyxUpdate[] = [
...(onyxTargetTransactionData.failureData ?? []),
failureSourceTransactionData,
...failureSourceReportData,
...failureTransactionViolations,
...failureSourceReportActionData,
];
const successData: OnyxUpdate[] = [...successSourceReportActionData, ...(onyxTargetTransactionData.successData ?? [])];

const successData: OnyxUpdate[] = [];
successData.push(...successSourceReportActionData);
successData.push(...(onyxTargetTransactionData.successData ?? []));

API.write(WRITE_COMMANDS.MERGE_TRANSACTION, params, {optimisticData, failureData, successData});
}
Expand Down
2 changes: 2 additions & 0 deletions src/libs/actions/Policy/Member.ts
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,7 @@ function removeMembers(policyID: string, selectedMemberEmails: string[], policyM
pendingChatMembers,
},
},
// @ts-expect-error - will be solved in https://github.com/Expensify/App/issues/73830
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${report?.reportID}`,
Expand Down Expand Up @@ -590,6 +591,7 @@ function removeMembers(policyID: string, selectedMemberEmails: string[], policyM
pendingChatMembers: null,
},
},
// @ts-expect-error - will be solved in https://github.com/Expensify/App/issues/73830
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${report?.reportID}`,
Expand Down
Loading