{"record":{"id":"23b47998f254bfce","repo":"tursodatabase/turso","slug":"unknown-result-type-resultkind","errorCode":null,"errorMessage":"Unknown result type: ${resultKind}","messagePattern":"Unknown result type: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"bindings/react-native/src/internal/asyncOperation.ts","lineNumber":60,"sourceCode":"    if (status === TursoStatus.DONE) {\n      // Extract and return the result based on result type\n      const resultKind = operation.resultKind();\n\n      switch (resultKind) {\n        case SyncOperationResultType.NONE:\n          return undefined as T;\n\n        case SyncOperationResultType.CONNECTION:\n          return operation.extractConnection() as T;\n\n        case SyncOperationResultType.CHANGES:\n          return operation.extractChanges() as T;\n\n        case SyncOperationResultType.STATS:\n          return operation.extractStats() as T;\n\n        default:\n          throw new Error(`Unknown result type: ${resultKind}`);\n      }\n    }\n\n    // Operation needs IO\n    if (status === TursoStatus.IO) {\n      // Process all pending IO items\n      await processIoQueue(database, context);\n\n      // Step callbacks after IO processing\n      database.ioStepCallbacks();\n\n      // Continue resume loop\n      continue;\n    }\n\n    // Any other status is an error\n    throw new Error(`Unexpected status from operation.resume(): ${status}`);\n  }","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/tursodatabase/turso/blob/244cde92a7df7f9b8b8b7a4075c35a12977e303e/bindings/react-native/src/internal/asyncOperation.ts#L42-L78","documentation":"After a sync operation finishes (resume() returns DONE), the driver reads resultKind() and only knows NONE, CONNECTION, CHANGES and STATS. Any other value hits the default branch and throws. Like 'Unknown column type', an out-of-enum result kind means the JS package and the native library disagree - the native side returned a value the installed JS code was never compiled to understand.","triggerScenarios":"Any sync operation driven to completion - connect(), pull(), push(), sync() - where the native binary is newer (or differently built) than @tursodatabase/sync-react-native and reports a result kind the JS SyncOperationResultType enum does not contain.","commonSituations":"Upgrading the native pods/gradle dependency ahead of the npm package (or the reverse); building native from a feature branch while shipping the released JS package.","solutions":["Pin the JS package and the native dependency to the same release version","Rebuild cleanly after aligning versions: pod install / ./gradlew clean, reinstall the app, reset Metro cache","Print the resultKind value - if it is not 0-3, include it in a bug report; if versions match, it is an SDK defect"],"exampleFix":"// before - native binary newer than the JS enum\nawait db.pull(); // throws `Unknown result type: 4`\n\n// after - same release on both sides\n// npm i @tursodatabase/sync-react-native@0.x.y && (cd ios && pod update Turso) || (cd android && ./gradlew clean)","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { await db.pull(); } catch (e) { if (e instanceof Error && e.message.startsWith('Unknown result type:')) { throw new Error('JS/native SDK version mismatch - rebuild the native app to match the npm package'); } throw e; }","preventionTips":["Upgrade JS and native SDK dependencies atomically in the same PR","Add a version assertion: compare mod.version() with the expected release in a dev-time check","Clean-rebuild native after every SDK version change"],"tags":["react-native","sync","version-mismatch","native-binding"],"backgroundTag":"native-enum-mismatch","analyzedSha":"244cde92a7df7f9b8b8b7a4075c35a12977e303e","analyzedAt":"2026-08-20T07:02:18.389Z","contentChangedAt":"2026-08-20T07:02:18.389Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}