From 11f0915044690e75b5a20befa92a3c37402e6f86 Mon Sep 17 00:00:00 2001 From: Alex Hall Date: Sat, 7 Dec 2024 12:40:57 +0200 Subject: [PATCH] Stop storing code entries --- frontend/src/RunCode.js | 18 +++++++++--------- frontend/src/book/store.js | 31 ++++++++++++++++--------------- 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/frontend/src/RunCode.js b/frontend/src/RunCode.js index fa24049c..275fe365 100644 --- a/frontend/src/RunCode.js +++ b/frontend/src/RunCode.js @@ -171,15 +171,15 @@ export const _runCode = wrapAsync(async function runCode({code, source}) { finishedLastRunResolve(); postCodeEntry({ - entry, - result: { - passed: data.passed, - messageSections: data.message_sections?.map(section => ({ - type: section.type, - messages: section.messages?.map(m => _.truncate(m, {length: 1000})), - })), - output: _.truncate(data.output, {length: 1000}), - }, + // entry, + // result: { + // passed: data.passed, + // messageSections: data.message_sections?.map(section => ({ + // type: section.type, + // messages: section.messages?.map(m => _.truncate(m, {length: 1000})), + // })), + // output: _.truncate(data.output, {length: 1000}), + // }, }); }); diff --git a/frontend/src/book/store.js b/frontend/src/book/store.js index 473b5db3..b2feeeae 100644 --- a/frontend/src/book/store.js +++ b/frontend/src/book/store.js @@ -514,19 +514,20 @@ export function logEvent(name, data = {}) { } export function postCodeEntry(codeEntry) { - const {user: {developerMode}, route, assistant: {numHints, requestingSolution}} = localState; - codeEntry = { - ...codeEntry, - state: { - developerMode, - page_route: route, - num_hints: numHints, - requesting_solution: requestingSolution, - }, - timestamp: new Date().toISOString(), - }; - console.log("Posting code entry", codeEntry); - if (isProduction) { - databaseRequest("POST", codeEntry, "code_entries").catch(e => console.error(e)); - } + // Disabling for now because this data isn't used. + // const {user: {developerMode}, route, assistant: {numHints, requestingSolution}} = localState; + // codeEntry = { + // ...codeEntry, + // state: { + // developerMode, + // page_route: route, + // num_hints: numHints, + // requesting_solution: requestingSolution, + // }, + // timestamp: new Date().toISOString(), + // }; + // console.log("Posting code entry", codeEntry); + // if (isProduction) { + // databaseRequest("POST", codeEntry, "code_entries").catch(e => console.error(e)); + // } }