fix(compute-worker): wrap state store methods to ensure correct invocation

Fix/refactor reconciliation logic to wrap getOpStateRecord and listOpStates methods
from the state store, ensuring they are invoked as functions rather than accessed
as properties. This improves type safety and prevents potential runtime errors
from improper method usage.
This commit is contained in:
Richard R 2026-06-13 14:03:54 -06:00
parent 358a56cc9a
commit 9520e26a00

View file

@ -55,8 +55,8 @@ export function createOperationReconciler(input: {
recoveryPromise = (async () => {
const recoveredStates = await recoverOrphanedOperations({
operationStateStore: {
getOpStateRecord: input.stateStore.getOpStateRecord!,
listOpStates: input.stateStore.listOpStates!,
getOpStateRecord: (opId) => input.stateStore.getOpStateRecord!(opId),
listOpStates: () => input.stateStore.listOpStates!(),
},
orchestrator: {
markFailedIfUnchanged: async (request) => {