Page MenuHomePhorge

D13010.1768511048.diff
No OneTemporary

Size
5 KB
Referenced Files
None
Subscribers
None

D13010.1768511048.diff

diff --git a/lib/reducers/db-ops-reducer.js b/lib/reducers/db-ops-reducer.js
--- a/lib/reducers/db-ops-reducer.js
+++ b/lib/reducers/db-ops-reducer.js
@@ -6,6 +6,7 @@
import type { MessageStoreOperation } from '../ops/message-store-ops.js';
import type { DBOpsStore } from '../types/db-ops-types.js';
import { messageTypes } from '../types/message-types-enum.js';
+import type { NotificationsCreationData } from '../types/notif-types.js';
import type { BaseAction, DispatchMetadata } from '../types/redux-types.js';
import type { StoreOperations } from '../types/store-ops-types.js';
import { values } from '../utils/objects.js';
@@ -18,7 +19,6 @@
queuedOps: rest,
};
}
-
return store;
}
@@ -69,6 +69,7 @@
store: DBOpsStore,
dispatchMetadata: ?DispatchMetadata,
inputOps: StoreOperations,
+ notificationsCreationData: ?NotificationsCreationData,
): DBOpsStore {
const areNewOpsPresent = values(inputOps).some(
opsArray => opsArray.length > 0,
@@ -85,19 +86,28 @@
messageSearchStoreOperations,
};
- if (dispatchMetadata && areNewOpsPresent) {
+ if (dispatchMetadata && areNewOpsPresent && notificationsCreationData) {
newEntry = {
dispatchMetadata,
ops,
+ notificationsCreationData,
+ };
+ } else if (areNewOpsPresent && notificationsCreationData) {
+ newEntry = {
+ ops,
+ notificationsCreationData,
};
} else if (areNewOpsPresent) {
newEntry = {
ops,
};
- } else if (dispatchMetadata) {
+ } else if (dispatchMetadata && notificationsCreationData) {
newEntry = {
dispatchMetadata,
+ notificationsCreationData,
};
+ } else if (dispatchMetadata) {
+ newEntry = { dispatchMetadata };
}
if (!newEntry) {
diff --git a/lib/types/db-ops-types.js b/lib/types/db-ops-types.js
--- a/lib/types/db-ops-types.js
+++ b/lib/types/db-ops-types.js
@@ -1,5 +1,6 @@
// @flow
+import type { NotificationsCreationData } from './notif-types.js';
import { type DispatchMetadata } from './redux-types.js';
import type { StoreOperations } from './store-ops-types.js';
@@ -7,9 +8,12 @@
| {
+dispatchMetadata: DispatchMetadata,
+ops?: ?StoreOperations,
+ +notificationsCreationData?: NotificationsCreationData,
}
| {
+ops: StoreOperations,
+ +dmOpID?: string,
+ +notificationsCreationData?: NotificationsCreationData,
};
export type DBOpsStore = {
diff --git a/lib/types/dm-ops.js b/lib/types/dm-ops.js
--- a/lib/types/dm-ops.js
+++ b/lib/types/dm-ops.js
@@ -4,6 +4,7 @@
import { clientAvatarValidator, type ClientAvatar } from './avatar-types.js';
import type { RawMessageInfo } from './message-types.js';
+import type { NotificationsCreationData } from './notif-types.js';
import type { OutboundP2PMessage } from './sqlite-types.js';
import {
type NonSidebarThickThreadType,
@@ -356,6 +357,7 @@
// with `outboundP2PMessages` to keep track of whether all P2P messages
// were queued on Tunnelbroker.
+messageIDWithoutAutoRetry: ?string,
+ +notificationsCreationData: ?NotificationsCreationData,
};
export const queueDMOpsActionType = 'QUEUE_DM_OPS';
diff --git a/native/redux/redux-setup.js b/native/redux/redux-setup.js
--- a/native/redux/redux-setup.js
+++ b/native/redux/redux-setup.js
@@ -28,6 +28,7 @@
identityInvalidSessionDowngrade,
} from 'lib/shared/session-utils.js';
import { isStaff } from 'lib/shared/staff-utils.js';
+import { processDMOpsActionType } from 'lib/types/dm-ops.js';
import type { Dispatch, BaseAction } from 'lib/types/redux-types.js';
import { rehydrateActionType } from 'lib/types/redux-types.js';
import type { SetSessionPayload } from 'lib/types/session-types.js';
@@ -312,6 +313,19 @@
...storeOperations,
threadStoreOperations: threadStoreOperationsWithUnreadFix,
};
+
+ if (action.type === processDMOpsActionType) {
+ const { notificationsCreationData } = action.payload;
+ return {
+ ...state,
+ dbOpsStore: queueDBOps(
+ state.dbOpsStore,
+ action.dispatchMetadata,
+ ops,
+ notificationsCreationData,
+ ),
+ };
+ }
state = {
...state,
dbOpsStore: queueDBOps(state.dbOpsStore, action.dispatchMetadata, ops),
diff --git a/web/redux/redux-setup.js b/web/redux/redux-setup.js
--- a/web/redux/redux-setup.js
+++ b/web/redux/redux-setup.js
@@ -39,6 +39,7 @@
import type { CommunityStore } from 'lib/types/community-types.js';
import type { DBOpsStore } from 'lib/types/db-ops-types.js';
import type { QueuedDMOperations } from 'lib/types/dm-ops.js';
+import { processDMOpsActionType } from 'lib/types/dm-ops.js';
import type { DraftStore } from 'lib/types/draft-types.js';
import type { EnabledApps } from 'lib/types/enabled-apps.js';
import type { EntryStore } from 'lib/types/entry-types.js';
@@ -539,6 +540,19 @@
return state;
}
+ if (action.type === processDMOpsActionType) {
+ const { notificationsCreationData } = action.payload;
+ return {
+ ...state,
+ dbOpsStore: queueDBOps(
+ state.dbOpsStore,
+ action.dispatchMetadata,
+ storeOperations,
+ notificationsCreationData,
+ ),
+ };
+ }
+
return {
...state,
dbOpsStore: queueDBOps(

File Metadata

Mime Type
text/plain
Expires
Thu, Jan 15, 9:04 PM (8 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5940029
Default Alt Text
D13010.1768511048.diff (5 KB)

Event Timeline