Skip to content

Commit 744d2d1

Browse files
committed
add TODO
1 parent a4b7d2d commit 744d2d1

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

packages/federation-sdk/src/services/edu.service.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export class EduService {
2424

2525
this.logger.debug(`Sending typing notification for room ${roomId}: ${userId} (typing: ${typing}) to all servers in room`);
2626

27+
// TODO we need a map of rooms and destinations to avoid having to get rooms state just to send an event to all servers in the room.
2728
const servers = await this.stateService.getServerSetInRoom(roomId);
2829
const uniqueServers = Array.from(servers).filter((server) => server !== origin);
2930

@@ -49,6 +50,7 @@ export class EduService {
4950

5051
await Promise.all(
5152
roomIds.map(async (roomId) => {
53+
// TODO we need a map of rooms and destinations to avoid having to get rooms state just to send an event to all servers in the room.
5254
const servers = await this.stateService.getServerSetInRoom(roomId);
5355
for (const server of servers) {
5456
if (server !== origin) {
@@ -104,6 +106,7 @@ export class EduService {
104106
`Sending read receipt for user ${userId} in room ${roomId} for events ${eventIds.join(', ')} to all servers in room`,
105107
);
106108

109+
// TODO we need a map of rooms and destinations to avoid having to get rooms state just to send an event to all servers in the room.
107110
const servers = await this.stateService.getServerSetInRoom(roomId);
108111
const uniqueServers = Array.from(servers).filter((server) => server !== origin);
109112

packages/federation-sdk/src/services/event-authorization.service.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ export class EventAuthorizationService {
249249
return false;
250250
}
251251

252+
// TODO we need a map of rooms and destinations to avoid having to get rooms state just to send an event to all servers in the room.
252253
const serversInRoom = await this.stateService.getServerSetInRoom(roomId, state);
253254
if (serversInRoom.has(serverName)) {
254255
this.logger.debug(`Server ${serverName} is in room, allowing access`);

packages/federation-sdk/src/services/federation.service.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ export class FederationService {
197197
}
198198

199199
async sendEventToAllServersInRoom(event: PersistentEventBase) {
200+
// TODO we need a map of rooms and destinations to avoid having to get rooms state just to send an event to all servers in the room.
200201
const servers = await this.stateService.getServerSetInRoom(event.roomId);
201202

202203
if (event.stateKey) {

0 commit comments

Comments
 (0)