fix(realtime): trip, member, chat, file, settings, tag and notification writes in parity

This commit is contained in:
Maurice
2026-10-22 12:14:27 +02:00
parent 8fe2ae80af
commit a79c3778e7
51 changed files with 2055 additions and 382 deletions
+17 -22
View File
@@ -167,15 +167,11 @@ export class CollabController {
@Body() body: CollabNoteCreateDto,
@Headers('x-socket-id') socketId?: string,
) {
const note = await this.collab.createNote(tripId, user.id, {
title: body.title,
content: body.content,
category: body.category,
color: body.color,
website: body.website,
});
this.collab.broadcast(tripId, 'collab:note:created', { note }, socketId);
await this.collab.notifyCollab(tripId, user);
const note = await this.collab.postNote(
tripId,
{ title: body.title, content: body.content, category: body.category, color: body.color, website: body.website },
this.collab.restWriter(tripId, user, socketId),
);
return { note };
}
@@ -525,25 +521,24 @@ export class CollabController {
}
const replyTo =
body.reply_to === undefined || body.reply_to === '' || body.reply_to === null ? null : Number(body.reply_to);
const result = await this.collab.createMessage(
const result = await this.collab.postMessage(
tripId,
user.id,
text,
Number.isFinite(replyTo as number) ? replyTo : null,
uploaded.map((file) => ({
filename: file.filename,
originalname: file.originalname,
size: file.size,
mimetype: file.mimetype,
})),
{
text,
replyTo: Number.isFinite(replyTo as number) ? replyTo : null,
files: uploaded.map((file) => ({
filename: file.filename,
originalname: file.originalname,
size: file.size,
mimetype: file.mimetype,
})),
},
this.collab.restWriter(tripId, user, socketId),
);
if (result.error === 'reply_not_found') {
for (const name of committed) await this.storage.delete('files', name).catch(() => {});
throw new HttpException({ error: 'Reply target message not found' }, 400);
}
this.collab.broadcast(tripId, 'collab:message:created', { message: result.message }, socketId);
const preview = text || 'sent an image';
await this.collab.notifyCollab(tripId, user, preview.length > 80 ? preview.substring(0, 80) + '...' : preview);
return { message: result.message };
}