Repository navigation
fix(ts): close the hook timeout template literal in hooks.ts - #1056
Conversation
The timeout Error in runWithTimeout was opened with a backtick and closed with a double quote, so vitest could not parse hooks.ts (introduced in 9478652). The same change also failed tsc --noEmit: dispatch's opts type omitted hook, runWithTimeout was passed a sync-or-async hook result, and hooksTimeout was multiplied before undefined was narrowed away. Co-authored-by: Nithilan Kumaran <sathariels@users.noreply.github.com>
|
Merged, and thank you for catching this. You were right that Confirmed before fixing: That is a real gap in my own verification and I have no excuse for it: I ran the TypeScript suite in earlier passes and did not in that one. On the merge itself, I took a different resolution than your diff, and you should check I got it right. Two of the three spots had already been fixed, better, by a drive-along commit in #1053 (
Your third fix, the So the parse fix is in and the tree is green: 34 files, 654 tests, One other thing worth knowing: |
14 pull requests from 8 contributors. * the TypeScript tree parses again: an unterminated template literal shipped in 0.4.1 and stopped 22 of 34 test files loading (#1056) * x_jev_confidence on /v1/systemone, computed locally (#1066, #302) * a narrowed shortlist drops option_order with a warning instead of failing (#1063) * registering a name one edit from a built-in warns (#1055, #919) * compose forwards four knobs the runtime already read (#1053, #1054) * Java Router.predictBatch and Shortlist.predictTournament (#1060, #1061) * teacher-agreement evals, with the self-agreement ceiling (#1071, #919) Security: no malicious content found; the audit is recorded locally. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Summary
laya-ts/src/hooks.tsdoesn't parse onmain. InrunWithTimeout, the hook timeoutErrormessage opens with a backtick but closes with a double quote (added in 9478652). Vitest fails with[PARSE_ERROR] Expected , or ) but found Identifieraround line 366, and 22 of the 34 TypeScript test files fail to load, so the TypeScript (node20/node22) check is red onmainand on every open PR.This closes the template literal with a backtick. The message text is unchanged:
hook ${operationName} timed out after ${timeoutMs}ms.Once it parsed,
tsc --noEmitflagged three more spots in that same timeout code, so I fixed those too:dispatch's opts type now includeshook?: Hook, which it already reads.Promise.resolve(...)beforerunWithTimeout, since a hook method can returnvoid.hooksTimeoutis narrowed with?? nullbefore converting to milliseconds.Tests
laya-ts:npm ci && npm test -- --run, 34 files and 654 tests passed (includes the type tests)npx tsc --noEmitpasses