@zeniai/client-epic-state 5.1.16-betaRD2 → 5.1.16-betaRD4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18,6 +18,11 @@ groupBy((action) => action.payload.selectedTab), mergeMap((group$) => group$.pip
18
18
  const { pageToken, sortOrder, sortKey } = uiState;
19
19
  const currentTenant = getCurrentTenant(state$.value);
20
20
  const selectedPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
21
+ console.log('[EA-SEARCH] fetchTransactionCategorizationEpic HTTP call', {
22
+ selectedTab,
23
+ refreshViewInBackground,
24
+ search_text: uiState.searchString,
25
+ });
21
26
  const queryParam = {
22
27
  start_date: toString(period.start),
23
28
  end_date: toString(period.end),
@@ -13,6 +13,12 @@ export const fetchTransactionCategorizationViewEpic = (actions$, state$) => acti
13
13
  const updateActions = [];
14
14
  const { expenseAutomationTransactionsViewState } = state$.value;
15
15
  const { fetchState, transactionIdsBySelectedPeriod } = expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTab];
16
+ console.log('[EA-SEARCH] fetchTransactionCategorizationViewEpic received', {
17
+ selectedTab,
18
+ cacheOverride,
19
+ searchString,
20
+ fetchState,
21
+ });
16
22
  const monthYearPeriod = {
17
23
  month: period.start.month,
18
24
  year: period.start.year,
@@ -40,9 +46,16 @@ export const fetchTransactionCategorizationViewEpic = (actions$, state$) => acti
40
46
  vendorOwnerList.fetchState === 'Not-Started') {
41
47
  updateActions.push(fetchOwnerList());
42
48
  }
49
+ console.log('[EA-SEARCH] view epic cache check', {
50
+ selectedTab,
51
+ cacheOverride,
52
+ fetchState,
53
+ transactionIdsBySelectedPeriod
54
+ });
43
55
  if (cacheOverride === true ||
44
56
  fetchState === 'Not-Started' ||
45
57
  transactionIds.length === 0) {
58
+ console.log('[EA-SEARCH] dispatching fetchTransactionCategorization for active tab', { selectedTab, searchString });
46
59
  updateActions.push(fetchTransactionCategorization(selectedTab, period, cacheOverride, keepExistingListItems, searchString, pageToken, refreshViewInBackground, resetListItems, isUncategorizedExpenseCategoryEnabled));
47
60
  }
48
61
  // When search changes (searchString defined, including empty string to
@@ -55,7 +68,14 @@ export const fetchTransactionCategorizationViewEpic = (actions$, state$) => acti
55
68
  if (searchString !== undefined) {
56
69
  TRANSACTIONS_TABS.filter((tab) => tab !== selectedTab).forEach((otherTab) => {
57
70
  const otherTabSearchString = expenseAutomationTransactionsViewState.transactionCategorizationView[otherTab].uiState.searchString;
71
+ console.log('[EA-SEARCH] dual-fetch check for other tab', {
72
+ otherTab,
73
+ searchString,
74
+ otherTabSearchString,
75
+ willDispatch: searchString !== otherTabSearchString,
76
+ });
58
77
  if (searchString !== otherTabSearchString) {
78
+ console.log('[EA-SEARCH] dispatching fetchTransactionCategorization for other tab', { otherTab, searchString });
59
79
  updateActions.push(fetchTransactionCategorization(otherTab, period, true, keepExistingListItems, searchString, undefined, true, true, isUncategorizedExpenseCategoryEnabled));
60
80
  }
61
81
  });
@@ -170,7 +170,7 @@ const expenseAutomationTransactionsView = createSlice({
170
170
  year: period.start.year,
171
171
  };
172
172
  const transactionIdsBySelectedPeriod = draft.transactionCategorizationView[selectedTab]
173
- .transactionIdsBySelectedPeriod[toMonthYearPeriodId(monthYearPeriod)];
173
+ .transactionIdsBySelectedPeriod[toMonthYearPeriodId(monthYearPeriod)] ?? [];
174
174
  transactionIdsBySelectedPeriod.forEach((transactionId) => {
175
175
  delete draft.transactionCategorizationView[selectedTab]
176
176
  .transactionReviewLocalDataById[transactionId];
@@ -21,6 +21,11 @@ const fetchTransactionCategorizationEpic = (actions$, state$, zeniAPI) => action
21
21
  const { pageToken, sortOrder, sortKey } = uiState;
22
22
  const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state$.value);
23
23
  const selectedPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
24
+ console.log('[EA-SEARCH] fetchTransactionCategorizationEpic HTTP call', {
25
+ selectedTab,
26
+ refreshViewInBackground,
27
+ search_text: uiState.searchString,
28
+ });
24
29
  const queryParam = {
25
30
  start_date: (0, timePeriod_1.toString)(period.start),
26
31
  end_date: (0, timePeriod_1.toString)(period.end),
@@ -16,6 +16,12 @@ const fetchTransactionCategorizationViewEpic = (actions$, state$) => actions$.pi
16
16
  const updateActions = [];
17
17
  const { expenseAutomationTransactionsViewState } = state$.value;
18
18
  const { fetchState, transactionIdsBySelectedPeriod } = expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTab];
19
+ console.log('[EA-SEARCH] fetchTransactionCategorizationViewEpic received', {
20
+ selectedTab,
21
+ cacheOverride,
22
+ searchString,
23
+ fetchState,
24
+ });
19
25
  const monthYearPeriod = {
20
26
  month: period.start.month,
21
27
  year: period.start.year,
@@ -43,9 +49,16 @@ const fetchTransactionCategorizationViewEpic = (actions$, state$) => actions$.pi
43
49
  vendorOwnerList.fetchState === 'Not-Started') {
44
50
  updateActions.push((0, ownerListReducer_1.fetchOwnerList)());
45
51
  }
52
+ console.log('[EA-SEARCH] view epic cache check', {
53
+ selectedTab,
54
+ cacheOverride,
55
+ fetchState,
56
+ transactionIdsBySelectedPeriod
57
+ });
46
58
  if (cacheOverride === true ||
47
59
  fetchState === 'Not-Started' ||
48
60
  transactionIds.length === 0) {
61
+ console.log('[EA-SEARCH] dispatching fetchTransactionCategorization for active tab', { selectedTab, searchString });
49
62
  updateActions.push((0, transactionsViewReducer_1.fetchTransactionCategorization)(selectedTab, period, cacheOverride, keepExistingListItems, searchString, pageToken, refreshViewInBackground, resetListItems, isUncategorizedExpenseCategoryEnabled));
50
63
  }
51
64
  // When search changes (searchString defined, including empty string to
@@ -58,7 +71,14 @@ const fetchTransactionCategorizationViewEpic = (actions$, state$) => actions$.pi
58
71
  if (searchString !== undefined) {
59
72
  transactionsViewState_1.TRANSACTIONS_TABS.filter((tab) => tab !== selectedTab).forEach((otherTab) => {
60
73
  const otherTabSearchString = expenseAutomationTransactionsViewState.transactionCategorizationView[otherTab].uiState.searchString;
74
+ console.log('[EA-SEARCH] dual-fetch check for other tab', {
75
+ otherTab,
76
+ searchString,
77
+ otherTabSearchString,
78
+ willDispatch: searchString !== otherTabSearchString,
79
+ });
61
80
  if (searchString !== otherTabSearchString) {
81
+ console.log('[EA-SEARCH] dispatching fetchTransactionCategorization for other tab', { otherTab, searchString });
62
82
  updateActions.push((0, transactionsViewReducer_1.fetchTransactionCategorization)(otherTab, period, true, keepExistingListItems, searchString, undefined, true, true, isUncategorizedExpenseCategoryEnabled));
63
83
  }
64
84
  });
@@ -177,7 +177,7 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
177
177
  year: period.start.year,
178
178
  };
179
179
  const transactionIdsBySelectedPeriod = draft.transactionCategorizationView[selectedTab]
180
- .transactionIdsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(monthYearPeriod)];
180
+ .transactionIdsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(monthYearPeriod)] ?? [];
181
181
  transactionIdsBySelectedPeriod.forEach((transactionId) => {
182
182
  delete draft.transactionCategorizationView[selectedTab]
183
183
  .transactionReviewLocalDataById[transactionId];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "5.1.16-betaRD2",
3
+ "version": "5.1.16-betaRD4",
4
4
  "description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/esm/index.js",