From 5865157a1b2e1f66734a4ceeb1d8859efae74cd3 Mon Sep 17 00:00:00 2001 From: Matchu Date: Tue, 5 Jan 2021 23:35:02 -0800 Subject: [PATCH] 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. --- src/server/loaders.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/server/loaders.js b/src/server/loaders.js index cc6009c..43ba4ec 100644 --- a/src/server/loaders.js +++ b/src/server/loaders.js @@ -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(",") : []; }); },