Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32064723
D12781.1764995525.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
5 KB
Referenced Files
None
Subscribers
None
D12781.1764995525.diff
View Options
diff --git a/lib/reducers/calendar-filters-reducer.js b/lib/reducers/calendar-filters-reducer.js
--- a/lib/reducers/calendar-filters-reducer.js
+++ b/lib/reducers/calendar-filters-reducer.js
@@ -27,6 +27,7 @@
} from '../selectors/calendar-filter-selectors.js';
import { threadInFilterList } from '../shared/thread-utils.js';
import { updateSpecs } from '../shared/updates/update-specs.js';
+import { processDMOpsActionType } from '../types/dm-ops.js';
import {
type CalendarFilter,
defaultCalendarFilters,
@@ -156,6 +157,8 @@
} else if (action.type === clearCalendarCommunityFilter) {
const nonThreadFilters = nonThreadCalendarFilters(state);
return nonThreadFilters;
+ } else if (action.type === processDMOpsActionType) {
+ return updateFilterListFromUpdateInfos(state, action.payload.updateInfos);
}
return state;
}
diff --git a/lib/reducers/entry-reducer.js b/lib/reducers/entry-reducer.js
--- a/lib/reducers/entry-reducer.js
+++ b/lib/reducers/entry-reducer.js
@@ -47,6 +47,7 @@
import { threadInFilterList } from '../shared/thread-utils.js';
import { updateSpecs } from '../shared/updates/update-specs.js';
import { isWebPlatform } from '../types/device-types.js';
+import { processDMOpsActionType } from '../types/dm-ops.js';
import type { RawEntryInfo, EntryStore } from '../types/entry-types.js';
import type { BaseAction } from '../types/redux-types.js';
import { type ClientEntryInconsistencyReportCreationRequest } from '../types/report-types.js';
@@ -774,6 +775,18 @@
entryStoreOperations: [],
reportCreationRequests: [],
};
+ } else if (action.type === processDMOpsActionType) {
+ const ops = mergeNewEntryInfosOps(
+ entryInfos,
+ daysToEntries,
+ mergeUpdateEntryInfos([], action.payload.updateInfos),
+ newThreadInfos,
+ );
+ return {
+ entryStore: entryStoreOpsHandlers.processStoreOperations(entryStore, ops),
+ entryStoreOperations: ops,
+ reportCreationRequests: [],
+ };
}
return {
entryStore,
diff --git a/lib/reducers/message-reducer.js b/lib/reducers/message-reducer.js
--- a/lib/reducers/message-reducer.js
+++ b/lib/reducers/message-reducer.js
@@ -78,6 +78,7 @@
import { unshimMessageInfos } from '../shared/unshim-utils.js';
import { updateSpecs } from '../shared/updates/update-specs.js';
import { recoveryFromReduxActionSources } from '../types/account-types.js';
+import { processDMOpsActionType } from '../types/dm-ops.js';
import type { Media, Image } from '../types/media-types.js';
import { messageTypes } from '../types/message-types-enum.js';
import {
@@ -1814,6 +1815,24 @@
messageStoreOperations,
messageStore: processedMessageStore,
};
+ } else if (action.type === processDMOpsActionType) {
+ const { rawMessageInfos, updateInfos } = action.payload;
+ if (rawMessageInfos.length === 0 && updateInfos.length === 0) {
+ return { messageStoreOperations: [], messageStore };
+ }
+
+ const messagesResult = mergeUpdatesWithMessageInfos(
+ rawMessageInfos,
+ updateInfos,
+ {},
+ );
+
+ return mergeNewMessages(
+ messageStore,
+ messagesResult.rawMessageInfos,
+ messagesResult.truncationStatuses,
+ newThreadInfos,
+ );
}
return { messageStoreOperations: [], messageStore };
}
diff --git a/lib/reducers/thread-activity-reducer.js b/lib/reducers/thread-activity-reducer.js
--- a/lib/reducers/thread-activity-reducer.js
+++ b/lib/reducers/thread-activity-reducer.js
@@ -24,6 +24,7 @@
type ThreadActivityStoreOperation,
} from '../ops/thread-activity-store-ops.js';
import { isWebPlatform } from '../types/device-types.js';
+import { processDMOpsActionType } from '../types/dm-ops.js';
import type { BaseAction } from '../types/redux-types.js';
import {
incrementalStateSyncActionType,
@@ -240,6 +241,8 @@
threadActivityStore: state,
threadActivityStoreOperations: [],
};
+ } else if (action.type === processDMOpsActionType) {
+ return handleThreadDeletionUpdates(state, action.payload.updateInfos);
}
return {
threadActivityStore: state,
diff --git a/lib/reducers/thread-reducer.js b/lib/reducers/thread-reducer.js
--- a/lib/reducers/thread-reducer.js
+++ b/lib/reducers/thread-reducer.js
@@ -37,6 +37,7 @@
} from '../ops/thread-store-ops.js';
import { stateSyncSpecs } from '../shared/state-sync/state-sync-specs.js';
import { updateSpecs } from '../shared/updates/update-specs.js';
+import { processDMOpsActionType } from '../types/dm-ops.js';
import type { RawThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js';
import type { BaseAction } from '../types/redux-types.js';
import { type ClientThreadInconsistencyReportCreationRequest } from '../types/report-types.js';
@@ -534,6 +535,28 @@
newThreadInconsistencies: [],
threadStoreOperations: [],
};
+ } else if (action.type === processDMOpsActionType) {
+ const { updateInfos } = action.payload;
+ if (updateInfos.length === 0) {
+ return {
+ threadStore: state,
+ newThreadInconsistencies: [],
+ threadStoreOperations: [],
+ };
+ }
+ const threadStoreOperations = generateOpsForThreadUpdates(
+ state.threadInfos,
+ updateInfos,
+ );
+ const updatedThreadStore = processThreadStoreOperations(
+ state,
+ threadStoreOperations,
+ );
+ return {
+ threadStore: updatedThreadStore,
+ newThreadInconsistencies: [],
+ threadStoreOperations,
+ };
}
return {
threadStore: state,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 6, 4:32 AM (6 h, 39 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5832164
Default Alt Text
D12781.1764995525.diff (5 KB)
Attached To
Mode
D12781: [lib] Reduce new PROCESS_DM_OPS action
Attached
Detach File
Event Timeline
Log In to Comment