Fix crash when there are too many trade matches

Oops, the GROUP_CONCAT string was getting cut off! This caused an error trying to look up the name of an item ID that didn't exist, because the ID got truncated partway through.
This commit is contained in:
Emi Matchu 2021-01-05 23:35:02 -08:00
parent 4a352e04e0
commit 5865157a1b

View file

@ -139,8 +139,9 @@ const buildTradeMatchesLoader = (db) =>
})
.flat();
const [rows, _] = await db.execute(
const [rows, _] = await db.query(
`
SET SESSION group_concat_max_len = 4096;
SELECT
public_user_hangers.user_id AS public_user_id,
current_user_hangers.user_id AS current_user_id,
@ -186,6 +187,9 @@ const buildTradeMatchesLoader = (db) =>
e.currentUserId === currentUserId &&
e.direction === direction
);
if (entity && entity.publicUserId == "26378") {
console.log(entity);
}
return entity ? entity.itemIds.split(",") : [];
});
},