Fix recordCommitLatency parameter type for the widened commitResolution union#1899
Conversation
…on union 6e6d57e widened commitResolution to Promise<number | void> | void for the LMDB-engine guard, leaving the recordCommitLatency(commitResolution) call a TS2345 on main. The recorder only times settlement and already guards for thenables, so take Promise<unknown> | void; the now-unneeded commit() cast goes with it. Type-only, no runtime change; unblocks the Next.js adapter CI leg, which builds harper with tsc errors fatal. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Reviewed; no blockers found. |
There was a problem hiding this comment.
Code Review
This pull request updates resources/DatabaseTransaction.ts to loosen the type of commitResolution in recordCommitLatency from Promise<void> to Promise<unknown> | void. This change allows for the removal of an explicit type cast (as Promise<void>) when assigning the result of transaction.commit(). No review comments were provided, and there is no additional feedback to offer.
|
Note: #1898 now carries a minimal version of this fix on its branch (3bf19a9, |
Main currently has a TS2345 at
resources/DatabaseTransaction.ts:413: 6e6d57ed8 widenedcommitResolutiontoPromise<number | void> | voidfor the LMDB-engine guard, butrecordCommitLatencystill declaredPromise<void>.The main build job tolerates tsc errors, but the Next.js adapter integration workflow builds harper with errors fatal — so this fails those checks on every PR (observed on #1898, all three Node versions).
The recorder only times settlement (fulfil or reject) and already thenable-guards, so it takes
Promise<unknown> | void; the now-redundantas Promise<void>cast ontransaction.commit()is removed with its stale comment. Type-only — no runtime change.tsc --noEmit -p tsconfig.build.jsonexits clean with this patch.🤖 Generated with Claude Code (Opus 4.8)