Skip to content
Open
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
2 changes: 2 additions & 0 deletions src/CONST/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2886,6 +2886,8 @@ const CONST = {
// Note: These payment types are used when building IOU reportAction message values in the server and should
// not be changed.
LOCATION_PERMISSION_PROMPT_THRESHOLD_DAYS: 7,
// Maximum number of days allowed for split expense date range
SPLIT_DATE_RANGE_LIMIT: 50,
Copy link
Member

@parasharrajat parasharrajat Dec 26, 2025

Choose a reason for hiding this comment

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

IMO, 50 is a magic number. This should be more systematic like 2 months/60 days or 30 days.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I already tested 60
And that's still a lot for iOS

Copy link
Member

@parasharrajat parasharrajat Dec 26, 2025

Choose a reason for hiding this comment

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

Yes, I noticed that even with fewer split,s like 13, this page is slow. I think we should optimize this page. 60 or 100 should be no problem as we are just creating data and rendering it list. Something on this page is very expensive or may be poorly implemented.

Copy link
Contributor Author

@ZhenjaHorbach ZhenjaHorbach Dec 26, 2025

Choose a reason for hiding this comment

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

When I tested 100 and 200 splits
Splits were easy to create
But when I tried to save and create split transactions
The app crashed

Copy link
Member

Choose a reason for hiding this comment

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

Yes especially when I save and the page closes, it was very slow.

Copy link
Contributor Author

@ZhenjaHorbach ZhenjaHorbach Dec 26, 2025

Choose a reason for hiding this comment

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

But on the other hand,
On the web,
700 transactions are created just fine
So everything works as expected.

But probably, iOS has some limitations with Onyx

But in any case, it's better to wait to see what the BZ team says
Since, in my opinion, even 30 or 45 splits would be enough
Since I doubt anyone will really need that many splits

Copy link
Member

Choose a reason for hiding this comment

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

Sure, sounds good.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay
I talk with @trjExpensify and @JmillsExpensify
Since this is an edge case
The current implementation in PR will be enough!

PAYMENT_TYPE: {
ELSEWHERE: 'Elsewhere',
EXPENSIFY: 'Expensify',
Expand Down
1 change: 1 addition & 0 deletions src/languages/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1366,6 +1366,7 @@ const translations: TranslationDeepObject<typeof en> = {
invalidRate: 'Satz für diesen Workspace ungültig. Bitte wählen Sie einen verfügbaren Satz aus dem Workspace aus.',
endDateBeforeStartDate: 'Das Enddatum darf nicht vor dem Startdatum liegen',
endDateSameAsStartDate: 'Das Enddatum darf nicht mit dem Startdatum identisch sein',
dateRangeExceedsMaxDays: `Der Datumsbereich darf ${CONST.IOU.SPLIT_DATE_RANGE_LIMIT} Tage nicht überschreiten`,
},
dismissReceiptError: 'Fehler ausblenden',
dismissReceiptErrorConfirmation: 'Achtung! Wenn du diesen Fehler verwirfst, wird dein hochgeladener Beleg vollständig entfernt. Bist du sicher?',
Expand Down
1 change: 1 addition & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1342,6 +1342,7 @@ const translations = {
invalidRate: 'Rate not valid for this workspace. Please select an available rate from the workspace.',
endDateBeforeStartDate: "The end date can't be before the start date",
endDateSameAsStartDate: "The end date can't be the same as the start date",
dateRangeExceedsMaxDays: `The date range can't exceed ${CONST.IOU.SPLIT_DATE_RANGE_LIMIT} days`,
},
dismissReceiptError: 'Dismiss error',
dismissReceiptErrorConfirmation: 'Heads up! Dismissing this error will remove your uploaded receipt entirely. Are you sure?',
Expand Down
1 change: 1 addition & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1041,6 +1041,7 @@ const translations: TranslationDeepObject<typeof en> = {
invalidRate: 'Tasa no válida para este espacio de trabajo. Por favor, selecciona una tasa disponible en el espacio de trabajo.',
endDateBeforeStartDate: 'La fecha de finalización no puede ser anterior a la fecha de inicio',
endDateSameAsStartDate: 'La fecha de finalización no puede ser la misma que la fecha de inicio',
dateRangeExceedsMaxDays: `El rango de fechas no puede exceder los ${CONST.IOU.SPLIT_DATE_RANGE_LIMIT} días`,
},
dismissReceiptError: 'Descartar error',
dismissReceiptErrorConfirmation: '¡Atención! Descartar este error eliminará completamente tu recibo cargado. ¿Estás seguro?',
Expand Down
1 change: 1 addition & 0 deletions src/languages/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1367,6 +1367,7 @@ const translations: TranslationDeepObject<typeof en> = {
invalidRate: 'Taux non valide pour cet espace de travail. Veuillez sélectionner un taux disponible dans l’espace de travail.',
endDateBeforeStartDate: 'La date de fin ne peut pas être antérieure à la date de début',
endDateSameAsStartDate: 'La date de fin ne peut pas être identique à la date de début',
dateRangeExceedsMaxDays: `La plage de dates ne peut pas dépasser ${CONST.IOU.SPLIT_DATE_RANGE_LIMIT} jours`,
},
dismissReceiptError: 'Ignorer l’erreur',
dismissReceiptErrorConfirmation: 'Attention ! Ignorer cette erreur supprimera entièrement votre reçu téléchargé. Êtes-vous sûr ?',
Expand Down
1 change: 1 addition & 0 deletions src/languages/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1361,6 +1361,7 @@ const translations: TranslationDeepObject<typeof en> = {
invalidRate: 'Tariffa non valida per questo workspace. Seleziona una tariffa disponibile dal workspace.',
endDateBeforeStartDate: 'La data di fine non può essere precedente alla data di inizio',
endDateSameAsStartDate: 'La data di fine non può essere uguale alla data di inizio',
dateRangeExceedsMaxDays: `L'intervallo di date non può superare i ${CONST.IOU.SPLIT_DATE_RANGE_LIMIT} giorni`,
},
dismissReceiptError: 'Ignora errore',
dismissReceiptErrorConfirmation: 'Attenzione! Se ignori questo errore, la ricevuta caricata verrà rimossa completamente. Sei sicuro?',
Expand Down
1 change: 1 addition & 0 deletions src/languages/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1361,6 +1361,7 @@ const translations: TranslationDeepObject<typeof en> = {
invalidRate: 'このワークスペースでは無効なレートです。ワークスペースから利用可能なレートを選択してください。',
endDateBeforeStartDate: '終了日は開始日より前にはできません',
endDateSameAsStartDate: '終了日は開始日と同じにはできません',
dateRangeExceedsMaxDays: `期間は${CONST.IOU.SPLIT_DATE_RANGE_LIMIT}日を超えることはできません`,
},
dismissReceiptError: 'エラーを閉じる',
dismissReceiptErrorConfirmation: '注意!このエラーを無視すると、アップロードした領収書が完全に削除されます。本当に実行しますか?',
Expand Down
1 change: 1 addition & 0 deletions src/languages/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1360,6 +1360,7 @@ const translations: TranslationDeepObject<typeof en> = {
invalidRate: 'Tarief is niet geldig voor deze workspace. Selecteer een beschikbaar tarief uit de workspace.',
endDateBeforeStartDate: 'De einddatum kan niet vóór de startdatum liggen',
endDateSameAsStartDate: 'De einddatum mag niet hetzelfde zijn als de startdatum',
dateRangeExceedsMaxDays: `Het datumbereik mag niet meer dan ${CONST.IOU.SPLIT_DATE_RANGE_LIMIT} dagen zijn`,
},
dismissReceiptError: 'Foutmelding sluiten',
dismissReceiptErrorConfirmation: 'Let op! Als je deze foutmelding negeert, wordt je geüploade bon volledig verwijderd. Weet je het zeker?',
Expand Down
1 change: 1 addition & 0 deletions src/languages/pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1358,6 +1358,7 @@ const translations: TranslationDeepObject<typeof en> = {
invalidRate: 'Stawka nie jest prawidłowa dla tego przestrzeni roboczej. Wybierz dostępną stawkę z tej przestrzeni roboczej.',
endDateBeforeStartDate: 'Data zakończenia nie może być wcześniejsza niż data rozpoczęcia',
endDateSameAsStartDate: 'Data zakończenia nie może być taka sama jak data rozpoczęcia',
dateRangeExceedsMaxDays: `Zakres dat nie może przekraczać ${CONST.IOU.SPLIT_DATE_RANGE_LIMIT} dni`,
},
dismissReceiptError: 'Odrzuć błąd',
dismissReceiptErrorConfirmation: 'Uwaga! Odrzucenie tego błędu spowoduje całkowite usunięcie przesłanego paragonu. Czy na pewno chcesz kontynuować?',
Expand Down
1 change: 1 addition & 0 deletions src/languages/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1358,6 +1358,7 @@ const translations: TranslationDeepObject<typeof en> = {
invalidRate: 'Taxa inválida para este workspace. Selecione uma taxa disponível do workspace.',
endDateBeforeStartDate: 'A data de término não pode ser anterior à data de início',
endDateSameAsStartDate: 'A data de término não pode ser igual à data de início',
dateRangeExceedsMaxDays: `O intervalo de datas não pode exceder ${CONST.IOU.SPLIT_DATE_RANGE_LIMIT} dias`,
},
dismissReceiptError: 'Dispensar erro',
dismissReceiptErrorConfirmation: 'Atenção! Ignorar este erro removerá completamente o seu recibo enviado. Tem certeza?',
Expand Down
1 change: 1 addition & 0 deletions src/languages/zh-hans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1338,6 +1338,7 @@ const translations: TranslationDeepObject<typeof en> = {
invalidRate: '此汇率对该工作区无效。请选择此工作区中的可用汇率。',
endDateBeforeStartDate: '结束日期不能早于开始日期',
endDateSameAsStartDate: '结束日期不能与开始日期相同',
dateRangeExceedsMaxDays: `日期范围不能超过${CONST.IOU.SPLIT_DATE_RANGE_LIMIT}天`,
},
dismissReceiptError: '忽略错误',
dismissReceiptErrorConfirmation: '提醒!关闭此错误会完全删除你上传的收据。确定要继续吗?',
Expand Down
3 changes: 3 additions & 0 deletions src/pages/iou/SplitExpenseCreateDateRagePage.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {differenceInDays} from 'date-fns';
import React from 'react';
import {View} from 'react-native';
import FullPageNotFoundView from '@components/BlockingViews/FullPageNotFoundView';
Expand Down Expand Up @@ -76,6 +77,8 @@ function SplitExpenseCreateDateRagePage({route}: SplitExpenseCreateDateRagePageP
errors[INPUT_IDS.END_DATE] = translate('iou.error.endDateBeforeStartDate');
} else if (endDate.getTime() === startDate.getTime()) {
errors[INPUT_IDS.END_DATE] = translate('iou.error.endDateSameAsStartDate');
} else if (differenceInDays(endDate, startDate) + 1 > CONST.IOU.SPLIT_DATE_RANGE_LIMIT) {
errors[INPUT_IDS.END_DATE] = translate('iou.error.dateRangeExceedsMaxDays');
}
}

Expand Down
Loading