{"record":{"id":"6a914422f4fe1339","repo":"dagger/dagger","slug":"encode-persisted-function-call-nil-function-call","errorCode":null,"errorMessage":"encode persisted function call: nil function call","messagePattern":"encode persisted function call: nil function call","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/typedef.go","lineNumber":2469,"sourceCode":"var _ dagql.PersistedObject = (*FunctionCall)(nil)\nvar _ dagql.PersistedObjectDecoder = (*FunctionCall)(nil)\n\nfunc (*FunctionCall) Type() *ast.Type {\n\treturn &ast.Type{\n\t\tNamedType: \"FunctionCall\",\n\t\tNonNull:   true,\n\t}\n}\n\nfunc (*FunctionCall) TypeDescription() string {\n\treturn \"An active function call.\"\n}\n\nfunc (fnCall *FunctionCall) EncodePersistedObject(ctx context.Context, cache dagql.PersistedObjectCache) (dagql.PersistedObjectEncoding, error) {\n\t_ = ctx\n\t_ = cache\n\tif fnCall == nil {\n\t\treturn dagql.PersistedObjectEncoding{}, fmt.Errorf(\"encode persisted function call: nil function call\")\n\t}\n\treturn encodePersistedObjectPayload(persistedFunctionCall(*fnCall))\n}\n\nfunc (*FunctionCall) DecodePersistedObject(ctx context.Context, dag *dagql.Server, _ uint64, _ *dagql.ResultCall, payload json.RawMessage) (dagql.Typed, error) {\n\t_ = ctx\n\t_ = dag\n\tvar persisted persistedFunctionCall\n\tif err := json.Unmarshal(payload, &persisted); err != nil {\n\t\treturn nil, fmt.Errorf(\"decode persisted function call payload: %w\", err)\n\t}\n\tfnCall := FunctionCall(persisted)\n\treturn &fnCall, nil\n}\n\nfunc (fnCall *FunctionCall) ReturnValue(ctx context.Context, val JSON) error {\n\t_ = ctx\n","sourceCodeStart":2451,"sourceCodeEnd":2487,"githubUrl":"https://github.com/dagger/dagger/blob/82ba2681dbe30d3547a1dc50ea495900ab5b6047/core/typedef.go#L2451-L2487","documentation":"EncodePersistedObject nil-guard: FunctionCall.EncodePersistedObject was invoked on a nil receiver. Persistence refuses to serialize a nil active function call instead of emitting a meaningless empty payload.","triggerScenarios":"Thrown at core/typedef.go:2469 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Skip the cache write when the function call is nil","Fix upstream flow that let a nil FunctionCall reach the persistence layer"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"82ba2681dbe30d3547a1dc50ea495900ab5b6047","analyzedAt":"2026-09-05T07:21:37.930Z","contentChangedAt":"2026-09-05T07:21:37.930Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}