diff --git a/.vscode/launch.json b/.vscode/launch.json index b7a3e1428f..ef271c3c99 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -51,7 +51,8 @@ // "SERVER_PROVIDER":"uweb" "SERVER_PROVIDER":"ws", "MODEL_VERSION": "", - "ELASTIC_INDEX_NAME": "local_storage_index" + "ELASTIC_INDEX_NAME": "local_storage_index", + "UPLOAD_URL": "/files", // "RETRANSLATE_URL": "http://127.0.0.1:4500", //"RETRANSLATE_URL": "https://208.167.249.201", diff --git a/server-plugins/chunter-resources/src/index.ts b/server-plugins/chunter-resources/src/index.ts index ace5add32c..5704fdde88 100644 --- a/server-plugins/chunter-resources/src/index.ts +++ b/server-plugins/chunter-resources/src/index.ts @@ -464,22 +464,22 @@ async function OnChannelMembersChanged (tx: TxUpdateDoc, control: Trigg const context = allContexts.find(({ user }) => user === addedMember) if (context === undefined) { - res.push( - control.txFactory.createTxCreateDoc(notification.class.DocNotifyContext, tx.objectSpace, { - attachedTo: tx.objectId, - attachedToClass: tx.objectClass, - user: addedMember, - hidden: false, - lastViewedTimestamp: tx.modifiedOn - }) - ) + const createTx = control.txFactory.createTxCreateDoc(notification.class.DocNotifyContext, tx.objectSpace, { + attachedTo: tx.objectId, + attachedToClass: tx.objectClass, + user: addedMember, + hidden: false, + lastViewedTimestamp: tx.modifiedOn + }) + + await control.apply([createTx], true) } else { - res.push( - control.txFactory.createTxUpdateDoc(context._class, context.space, context._id, { - hidden: false, - lastViewedTimestamp: tx.modifiedOn - }) - ) + const updateTx = control.txFactory.createTxUpdateDoc(context._class, context.space, context._id, { + hidden: false, + lastViewedTimestamp: tx.modifiedOn + }) + + await control.apply([updateTx], true) } } diff --git a/server-plugins/notification-resources/src/index.ts b/server-plugins/notification-resources/src/index.ts index e019726e62..bbe3b21fbe 100644 --- a/server-plugins/notification-resources/src/index.ts +++ b/server-plugins/notification-resources/src/index.ts @@ -403,15 +403,14 @@ export async function pushInboxNotifications ( hidden: false, lastUpdateTimestamp: shouldUpdateTimestamp ? modifiedOn : undefined }) - res.push(createContextTx) + await control.apply([createContextTx], true) docNotifyContextId = createContextTx.objectId } else { if (shouldUpdateTimestamp) { - res.push( - control.txFactory.createTxUpdateDoc(context._class, context.space, context._id, { - lastUpdateTimestamp: modifiedOn - }) - ) + const updateTx = control.txFactory.createTxUpdateDoc(context._class, context.space, context._id, { + lastUpdateTimestamp: modifiedOn + }) + await control.apply([updateTx], true) } docNotifyContextId = context._id }