Skip to content

Commit c2aeb46

Browse files
committed
fix match callback on problem row dialog
1 parent 4767563 commit c2aeb46

File tree

8 files changed

+3501
-4294
lines changed

8 files changed

+3501
-4294
lines changed

matching-service/src/lib/hasher.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import crypto from 'crypto';
1+
import crypto from "crypto";
22

33
export const generateMatchId = (userId: string, matchId: string): string => {
4-
// Concatenate the IDs
5-
const combinedIds = `${userId}-${matchId}`;
4+
// Concatenate the IDs
5+
const combinedIds = `${userId}-${matchId}`;
66

7-
// Hash the concatenated string using SHA-256
8-
return crypto.createHash('sha256').update(combinedIds).digest('hex');
9-
};
7+
// Hash the concatenated string using SHA-256
8+
return crypto.createHash("sha256").update(combinedIds).digest("hex");
9+
};

matching-service/src/services/matchingService.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export const processOldUsers = async (): Promise<void> => {
5555
const match = await checkMatch(`difficulty:${user.difficulty}`);
5656
if (match) {
5757
// Send to user subscribed queues if there is a match
58-
const matchId = generateMatchId(match._id, user._id)
58+
const matchId = generateMatchId(match._id, user._id);
5959
await sendToQueue(match._id, {
6060
status: "matched",
6161
matchId: matchId,
@@ -102,7 +102,7 @@ export const processNewMessage = async (user: User): Promise<void> => {
102102
const match = await checkMatch(`topic:${user.topic}`);
103103
// match found
104104
if (match) {
105-
const matchId = generateMatchId(match._id, user._id)
105+
const matchId = generateMatchId(match._id, user._id);
106106
await sendToQueue(match._id, {
107107
status: "matched",
108108
matchId: matchId,

0 commit comments

Comments
 (0)