mirror of
https://github.com/colanode/colanode.git
synced 2025-12-29 00:25:03 +01:00
Fix a case for sending changes when a new workspace/user is created
This commit is contained in:
@@ -226,18 +226,6 @@ class SynapseService {
|
||||
const idType = getIdType(data.nodeId);
|
||||
if (idType === IdType.User) {
|
||||
await this.addNewWorkspaceUser(data.nodeId, data.workspaceId);
|
||||
} else if (idType === IdType.Workspace) {
|
||||
const userDevices = this.getWorkspaceUserDevices(data.workspaceId);
|
||||
for (const deviceIds of userDevices.values()) {
|
||||
for (const deviceId of deviceIds) {
|
||||
const socketConnection = this.connections.get(deviceId);
|
||||
if (!socketConnection) {
|
||||
continue;
|
||||
}
|
||||
|
||||
this.sendPendingChangesDebounced(socketConnection);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
await this.broadcastNodeChange(data);
|
||||
@@ -263,6 +251,11 @@ class SynapseService {
|
||||
)
|
||||
.execute();
|
||||
|
||||
this.logger.trace(
|
||||
userNodes,
|
||||
`User nodes for ${data.nodeId} with ${userNodes.length} users`
|
||||
);
|
||||
|
||||
if (userNodes.length === 0) {
|
||||
return;
|
||||
}
|
||||
@@ -546,6 +539,8 @@ class SynapseService {
|
||||
workspaceId,
|
||||
userId,
|
||||
});
|
||||
|
||||
this.sendPendingChangesDebounced(connection);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user