修改了同步oper的判断条件,即使是自身用户,只要不是同步的oper,在这里也同步

This commit is contained in:
Xu Chang 2024-03-31 21:34:09 +08:00
parent 505eb74bd6
commit 2efe695aa0
2 changed files with 3 additions and 3 deletions

View File

@ -229,7 +229,7 @@ class Synchronizer {
this.pushOperToChannel(oper2, userId, url, endpoint, entity, entityId, selfEncryptInfo, onSynchronized);
};
for (const userId in userSendDict) {
if (userId !== operatorId) {
if (userId !== operatorId || oper.bornAt) {
await pushToUserIdFn(userId);
pushed = true;
}

View File

@ -326,7 +326,7 @@ export default class Synchronizer<ED extends EntityDict & BaseEntityDict, Cxt ex
};
for (const userId in userSendDict) {
if (userId !== operatorId) {
if (userId !== operatorId || oper.bornAt) {
await pushToUserIdFn(userId);
pushed = true;
}
@ -560,7 +560,7 @@ export default class Synchronizer<ED extends EntityDict & BaseEntityDict, Cxt ex
action: 'create',
when: 'commit',
strict: 'makeSure',
check: (operation: ED['oper']['Create']) => {
check: (operation: ED['oper']['Create']) => {
const { data } = operation as ED['oper']['CreateSingle'];
const { targetEntity, action } = data;
return pushEntities.includes((<ED['oper']['CreateSingle']['data']>data).targetEntity!)