Skip to content

Commit f438aeb

Browse files
committed
fix(api): relax chat.syncMessages response schema for deleted/cursor
- Updated deleted field schema to allow flexible objects instead of strict IMessage - Prevents validation mismatch with actual getMessageHistory output - Ensures 200 response validation does not fail for valid responses - Keeps updated field strictly typed as IMessage
1 parent 917c41f commit f438aeb

File tree

1 file changed

+5
-1
lines changed
  • apps/meteor/app/api/server/v1

1 file changed

+5
-1
lines changed

apps/meteor/app/api/server/v1/chat.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ import type { ExtractRoutesFromAPI } from '../ApiClass';
5353
import { API } from '../api';
5454
import { getPaginationItems } from '../helpers/getPaginationItems';
5555
import { findDiscussionsFromRoom, findMentionedMessages, findStarredMessages } from '../lib/messages';
56+
import { object } from 'underscore';
5657

5758
type ChatStarMessageLocal = {
5859
messageId: IMessage['_id'];
@@ -294,7 +295,10 @@ const isSyncMessagesResponse = ajv.compile<{
294295
},
295296
deleted: {
296297
type: 'array',
297-
items: { $ref: '#/components/schemas/IMessage' },
298+
items: {
299+
type: 'object',
300+
additionalProperties: true,
301+
},
298302
},
299303
cursor: {
300304
type: 'object',

0 commit comments

Comments
 (0)