Skip to content

Commit 381d93e

Browse files
committed
Fix single-challenge syncs
1 parent 4c73ea8 commit 381d93e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pages/api/sync.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ type SyncInfo = {
3535
id: UserId,
3636
};
3737

38-
const uuidIsntAll0s = (uuid: string) => uuid.split("").filter(c => !isNaN(parseInt(c, 16))).every(c => c !== "0");
39-
4038
const isValidBody = (body: unknown): body is { __type: string, id?: string } => {
4139
try {
4240
const { __type, id } = body as { __type: string, id?: string };
@@ -53,7 +51,7 @@ const isValidBody = (body: unknown): body is { __type: string, id?: string } =>
5351
const getSyncType = ({ __type, id }: { __type: string, id?: string }): SyncInfo | null => {
5452
const validatedId = id && uuidFromStr(id);
5553

56-
if (validatedId && uuidIsntAll0s(id)) {
54+
if (validatedId) {
5755
switch (__type) {
5856
case "user": {
5957
const userId = userIdFromStr(id);
@@ -73,6 +71,7 @@ const getSyncType = ({ __type, id }: { __type: string, id?: string }): SyncInfo
7371
}
7472
case "chall": {
7573
const challId = challIdFromStr(id);
74+
apiLogger.trace`Chall Id: ${challId}`
7675
if (!challId) return null;
7776
else return {
7877
__type: SyncType.CHALL,

0 commit comments

Comments
 (0)