fix(workflow): map sizeByte BigInt to Number in getAssetActivity for Temporal serialization

This commit is contained in:
yiling
2026-07-29 22:31:25 +08:00
parent cd8a9e58fd
commit 668871b730
3 changed files with 19 additions and 2 deletions
+6
View File
@@ -4,6 +4,12 @@ import { PrismaClient, WorkflowTask } from './generated/prisma/client'
import { PrismaTestingHelper } from './prisma-testing-helper'
import { generateNgrams } from './utils/ngram'
// Ensure BigInt serializes to JSON number gracefully for Temporal/HTTP payloads
// eslint-disable-next-line @typescript-eslint/no-explicit-any
;(BigInt.prototype as any).toJSON = function () {
return Number(this)
}
// Global callback for workflow task creation (decouples db package from workflow engine)
type WorkflowTriggerCallback = (task: WorkflowTask) => Promise<void>
let onWorkflowTaskCreated: WorkflowTriggerCallback | null = null