From e7457dac0d34a1a68ec3a467e80c3bf57203e0d0 Mon Sep 17 00:00:00 2001 From: Kevin Nadro Date: Wed, 5 Feb 2025 12:43:25 -0600 Subject: [PATCH] fix: adding comment to clarify the gotcha --- src/lib/useCalculateKclExpression.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib/useCalculateKclExpression.ts b/src/lib/useCalculateKclExpression.ts index 3e46250f6..55915c74c 100644 --- a/src/lib/useCalculateKclExpression.ts +++ b/src/lib/useCalculateKclExpression.ts @@ -48,6 +48,10 @@ export function useCalculateKclExpression({ bodyPath: [], }) const [valueNode, setValueNode] = useState(null) + // Gotcha: If we do not attempt to parse numeric literals instantly it means that there is an async action to verify + // the value is good. This means all E2E tests have a race condition on when they can hit "next" in the commad bar. + // Most scenarios automatically pass a numeric literal. We can try to parse that first, otherwise make it go through the slow + // async method. // If we pass in numeric literals, we should instantly parse them, they have nothing to do with application memory const _code_value = `const __result__ = ${value}` const codeValueParseResult = parse(_code_value)