Small fixes

This commit is contained in:
Hakan Shehu
2024-10-14 23:17:44 +02:00
parent a1a0d98c0f
commit 9ae3a3a692
3 changed files with 16 additions and 18 deletions

View File

@@ -44,19 +44,18 @@ class Synchronizer {
change.workspaceId,
change.data,
);
if (executed) {
await mediator.executeMessage(
{
accountId,
deviceId: change.deviceId,
},
{
type: 'server_change_result',
changeId: change.id,
success: executed,
},
);
}
await mediator.executeMessage(
{
accountId,
deviceId: change.deviceId,
},
{
type: 'server_change_result',
changeId: change.id,
success: executed,
},
);
}
private async executeServerChange(

View File

@@ -107,7 +107,6 @@ const createNodesTable: Migration = {
const createClosureTable: Migration = {
up: async (db) => {
// Create closure table for storing paths between nodes
await db.schema
.createTable('node_paths')
.addColumn('ancestor_id', 'varchar(30)', (col) =>

View File

@@ -125,16 +125,16 @@ syncRouter.post(
}
const results: ServerSyncChangeResult[] = [];
for (const mutation of input.changes) {
for (const change of input.changes) {
try {
const result = await handleLocalChange(workspaceUser, mutation);
const result = await handleLocalChange(workspaceUser, change);
results.push({
id: mutation.id,
id: change.id,
status: result.status,
});
} catch (error) {
results.push({
id: mutation.id,
id: change.id,
status: 'error',
});
}