@zeniai/client-epic-state 5.2.51-betaRD1 → 5.2.52-betaRD1

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.
@@ -22,7 +22,12 @@ export const initializeJeScheduleLocalDataEpic = (actions$, state$) => actions$.
22
22
  // Retry button. An empty array is possible when details have not landed yet; it must not
23
23
  // throw, because this runs in a mergeMap with no catchError and the throw would take the
24
24
  // epic's subscription down for the rest of the session.
25
- jeScheduledTransaction.scheduledJournalEntry.forEach((journalEntry) => {
25
+ // Filtered on `error` for the same reason the selector is: this array is shared state, and
26
+ // a schedule whose detail page has been opened holds every month it has, posted ones
27
+ // included. The seeding and the rows must agree on which entries are failed postings.
28
+ jeScheduledTransaction.scheduledJournalEntry
29
+ .filter((journalEntry) => journalEntry.error.length > 0)
30
+ .forEach((journalEntry) => {
26
31
  const { scheduledJournalEntryID } = journalEntry;
27
32
  actions.push(updateJeScheduleLocalDataById({
28
33
  localData: {
@@ -288,7 +288,15 @@ export function getExpenseAutomationJESchedulesView(state) {
288
288
  getJEScheduleRowType(schedule) === selectedJETypeFilter;
289
289
  const unsortedResolveSchedules = [];
290
290
  failedJeScheduledTransaction.forEach((schedule) => {
291
- schedule.scheduledJournalEntry.forEach((journalEntry) => {
291
+ // Only the entries that actually carry an error. The schedule's entry array is shared state:
292
+ // opening a schedule's detail page or Quick View replaces it with every month the schedule
293
+ // has, posted ones included, so fanning out over all of them turned one failed posting into a
294
+ // row per month -- and a month that never failed has nothing to resolve, so it rendered with
295
+ // an empty action column. Keying on `error` also makes the list self-correcting: an entry the
296
+ // server no longer reports as failing drops out on the next fetch.
297
+ schedule.scheduledJournalEntry
298
+ .filter((journalEntry) => journalEntry.error.length > 0)
299
+ .forEach((journalEntry) => {
292
300
  unsortedResolveSchedules.push({
293
301
  ...schedule,
294
302
  scheduledJournalEntry: journalEntry,
@@ -25,7 +25,12 @@ const initializeJeScheduleLocalDataEpic = (actions$, state$) => actions$.pipe((0
25
25
  // Retry button. An empty array is possible when details have not landed yet; it must not
26
26
  // throw, because this runs in a mergeMap with no catchError and the throw would take the
27
27
  // epic's subscription down for the rest of the session.
28
- jeScheduledTransaction.scheduledJournalEntry.forEach((journalEntry) => {
28
+ // Filtered on `error` for the same reason the selector is: this array is shared state, and
29
+ // a schedule whose detail page has been opened holds every month it has, posted ones
30
+ // included. The seeding and the rows must agree on which entries are failed postings.
31
+ jeScheduledTransaction.scheduledJournalEntry
32
+ .filter((journalEntry) => journalEntry.error.length > 0)
33
+ .forEach((journalEntry) => {
29
34
  const { scheduledJournalEntryID } = journalEntry;
30
35
  actions.push((0, jeSchedulesViewReducer_1.updateJeScheduleLocalDataById)({
31
36
  localData: {
@@ -303,7 +303,15 @@ function getExpenseAutomationJESchedulesView(state) {
303
303
  getJEScheduleRowType(schedule) === selectedJETypeFilter;
304
304
  const unsortedResolveSchedules = [];
305
305
  failedJeScheduledTransaction.forEach((schedule) => {
306
- schedule.scheduledJournalEntry.forEach((journalEntry) => {
306
+ // Only the entries that actually carry an error. The schedule's entry array is shared state:
307
+ // opening a schedule's detail page or Quick View replaces it with every month the schedule
308
+ // has, posted ones included, so fanning out over all of them turned one failed posting into a
309
+ // row per month -- and a month that never failed has nothing to resolve, so it rendered with
310
+ // an empty action column. Keying on `error` also makes the list self-correcting: an entry the
311
+ // server no longer reports as failing drops out on the next fetch.
312
+ schedule.scheduledJournalEntry
313
+ .filter((journalEntry) => journalEntry.error.length > 0)
314
+ .forEach((journalEntry) => {
307
315
  unsortedResolveSchedules.push({
308
316
  ...schedule,
309
317
  scheduledJournalEntry: journalEntry,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "5.2.51-betaRD1",
3
+ "version": "5.2.52-betaRD1",
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",