{"record":{"id":"3ca67606e29d3203","repo":"JuliusBrussee/caveman","slug":"ccr-typed-object-put-rows-w","errorCode":null,"errorMessage":"ccr typed object put rows: %w","messagePattern":"ccr typed object put rows: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/ccr/store_sqlite.go","lineNumber":534,"sourceCode":"\t\t`INSERT INTO typed_objects (\n\t\t object_id, object_type, content_hash, source, created_at, repository_state,\n\t\t session_id, transform_version, currentness, lifecycle, dependencies_json,\n\t\t original_byte_length, stored_byte_length, data\n\t\t) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?)\n\t\tON CONFLICT(object_id) DO NOTHING`,\n\t\tobj.ID, obj.Type, obj.ContentHash, obj.Source, obj.CreatedAt.Format(time.RFC3339Nano),\n\t\tobj.RepositoryState, obj.SessionID, obj.TransformVersion, obj.Currentness,\n\t\tobj.Lifecycle, string(deps), obj.OriginalByteLength, obj.StoredByteLength, obj.Data,\n\t)\n\tif err != nil {\n\t\tif isFull(err) {\n\t\t\treturn \"\", fmt.Errorf(\"ccr typed object put: %w\", ErrBudgetExceeded)\n\t\t}\n\t\treturn \"\", fmt.Errorf(\"ccr typed object put: %w\", err)\n\t}\n\tinserted, err := result.RowsAffected()\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"ccr typed object put rows: %w\", err)\n\t}\n\tif inserted == 0 {\n\t\texisting, err := s.GetObject(obj.ID)\n\t\tif err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"ccr typed object collision lookup: %w\", err)\n\t\t}\n\t\tif !sameImmutableObject(existing, obj) {\n\t\t\treturn \"\", errors.New(\"ccr: typed object id collision\")\n\t\t}\n\t}\n\treturn obj.ID, nil\n}\n\nfunc scanObject(scanner interface{ Scan(...any) error }) (Object, error) {\n\tvar obj Object\n\tvar created, deps string\n\tif err := scanner.Scan(\n\t\t&obj.ID, &obj.Type, &obj.ContentHash, &obj.Source, &created, &obj.RepositoryState,","sourceCodeStart":516,"sourceCodeEnd":552,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/766dce6b1394ebb56a3090748d5a0240a5aefb36/engine/ccr/store_sqlite.go#L516-L552","documentation":"Wraps the RowsAffected call after the typed-object INSERT in PutObject. The insert's conflict handling relies on reading the affected-row count; if the driver cannot report it, idempotency cannot be confirmed and the put fails.","triggerScenarios":"Thrown at engine/ccr/store_sqlite.go:534 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the wrapped driver error","Retry the idempotent put — ON CONFLICT DO NOTHING makes retries safe","Verify the sqlite driver version supports RowsAffected reliably"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"766dce6b1394ebb56a3090748d5a0240a5aefb36","analyzedAt":"2026-08-18T03:14:35.516Z","contentChangedAt":"2026-08-18T03:14:35.516Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}