summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/Server.ts2
-rw-r--r--src/opcodes/LazyRequest.ts3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/Server.ts b/src/Server.ts

index 193bdad1..46ff56a3 100644 --- a/src/Server.ts +++ b/src/Server.ts
@@ -30,7 +30,7 @@ export class Server { async setupSchema() { // TODO: adjust expireAfterSeconds -> lower - await db.collection("events").createIndex({ created_at: 1 }, { expireAfterSeconds: 60 }); + await Promise.all([db.collection("events").createIndex({ created_at: 1 }, { expireAfterSeconds: 60 })]); } async listen(): Promise<void> { diff --git a/src/opcodes/LazyRequest.ts b/src/opcodes/LazyRequest.ts
index 1d52ff3c..8b97e84a 100644 --- a/src/opcodes/LazyRequest.ts +++ b/src/opcodes/LazyRequest.ts
@@ -14,6 +14,7 @@ import { Send } from "../util/Send"; import WebSocket from "../util/WebSocket"; import { check } from "./instanceOf"; +// TODO: check permission and only show roles/members that have access to this channel // TODO: config: if want to list all members (even those who are offline) sorted by role, or just those who are online export async function onLazyRequest(this: WebSocket, { d }: Payload) { @@ -41,7 +42,7 @@ export async function onLazyRequest(this: WebSocket, { d }: Payload) { let: { id: "$id" }, pipeline: [ { $match: { $expr: { $in: ["$$id", "$roles"] } } }, - { $limit: 1 }, + { $limit: 100 }, { $lookup: { from: "users",