fix tests

This commit is contained in:
Barış Soner Uşaklı
2023-07-27 17:39:14 -04:00
parent d652da61d8
commit 48a66b74f1
4 changed files with 7 additions and 5 deletions

View File

@@ -37,9 +37,9 @@ MessageObject:
roomId:
type: number
deleted:
type: boolean
type: number
system:
type: boolean
type: number
edited:
type: number
timestampISO:

View File

@@ -59,9 +59,9 @@ get:
roomId:
type: string
deleted:
type: boolean
type: number
system:
type: boolean
type: number
edited:
type: number
timestampISO:

View File

@@ -67,6 +67,7 @@ module.exports = function (Messaging) {
Messaging.addMessageToRoom(roomId, mid, timestamp),
Messaging.markRead(uid, roomId),
db.sortedSetAdd('messages:mid', timestamp, mid),
db.incrObjectField('global', 'messageCount'),
];
if (roomData.public) {
tasks.push(

View File

@@ -4,7 +4,6 @@
const db = require('../../database');
const batch = require('../../batch');
module.exports = {
name: 'Set mid on message objects and create messages:mid',
timestamp: Date.UTC(2023, 6, 27),
@@ -41,5 +40,7 @@ module.exports = {
}, {
batch: 500,
});
const count = await db.sortedSetCard(`messages:mid`);
await db.setObjectField('global', 'messageCount', count);
},
};