{"record":{"id":"0650f5996071afdc","repo":"tursodatabase/turso","slug":"invalid-mvcc-pull-revision-generation-revision","errorCode":null,"errorMessage":"invalid MVCC pull revision generation: {revision}","messagePattern":"invalid MVCC pull revision generation: (.+?)","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"cli/sync_server.rs","lineNumber":1040,"sourceCode":"            \"MVCC logical pull is not supported for in-memory sync server databases\"\n        ));\n    }\n    let path = if let Some(rest) = db_path.strip_prefix(\"file:\") {\n        rest.split_once('?').map_or(rest, |(path, _)| path)\n    } else {\n        db_path\n    };\n    Ok(PathBuf::from(path))\n}\n\nfn parse_mvcc_revision_offset(revision: &str, legacy_default: u64) -> Result<u64> {\n    if revision.is_empty() {\n        return Ok(0);\n    }\n    if let Some((generation, offset)) = revision.split_once(\":o\") {\n        let generation = generation\n            .strip_prefix('g')\n            .ok_or_else(|| anyhow!(\"invalid MVCC pull revision generation: {revision}\"))?\n            .parse::<u64>()\n            .map_err(|err| anyhow!(\"invalid MVCC pull revision generation: {revision}: {err}\"))?;\n        if generation != 1 {\n            return Err(anyhow!(\n                \"sync_server supports only single-generation MVCC logical pulls: {revision}\"\n            ));\n        }\n        return offset\n            .parse::<u64>()\n            .map_err(|err| anyhow!(\"invalid MVCC pull revision offset: {revision}: {err}\"));\n    }\n    // Older page bootstrap responses from this test server used WAL frame\n    // numbers. Treat them as \"the page snapshot already includes the current\n    // logical log\" so the required follow-up logical pull becomes a no-op.\n    Ok(legacy_default)\n}\n\nfn scan_mvcc_log(log: &[u8]) -> Result<MvccLogSnapshot> {","sourceCodeStart":1022,"sourceCodeEnd":1058,"githubUrl":"https://github.com/tursodatabase/turso/blob/492c4a71cd7c2649e7df83da1471b74f4b1c7aa9/cli/sync_server.rs#L1022-L1058","documentation":"MVCC pull revisions must have the form g<GENERATION>:o<OFFSET>. parse_mvcc_revision_offset splits on \":o\" and requires the left segment to start with 'g'. This variant fires when the generation segment lacks the g prefix, e.g. \"1:o5\" or \"v2:o5\".","triggerScenarios":"A client sends client_revision = \"1:o128\" (missing g) to POST /pull-updates with the MVCC logical stream kind; the split on \":o\" succeeds but strip_prefix('g') fails.","commonSituations":"Hand-building revision strings in test clients; porting client code from a different revision format; typos when composing the string.","solutions":["Format revisions strictly as g<N>:o<M> (this server only accepts generation 1)","Echo back the exact revision string the server returned instead of reconstructing it"],"exampleFix":"// before\nreq.client_revision = \"1:o8192\".to_string();\n\n// after\nreq.client_revision = \"g1:o8192\".to_string();","handlingStrategy":"type-guard","validationCode":"const MVCC_REVISION_RE = /^g\\d+:o\\d+$/;\nif (!MVCC_REVISION_RE.test(revision)) {\n    throw new Error(`invalid MVCC revision '${revision}', expected g<gen>:o<offset>`);\n}","typeGuard":"function isMvccRevision(s: string): s is string {\n    return /^g\\d+:o\\d+$/.test(s);\n}","tryCatchPattern":null,"preventionTips":["Build revisions only via format!(\"g{}:o{}\", gen, offset)","Echo server-returned revisions verbatim instead of reconstructing them"],"tags":["mvcc","revision","parsing","sync-server"],"backgroundTag":"invalid-revision-string","analyzedSha":"492c4a71cd7c2649e7df83da1471b74f4b1c7aa9","analyzedAt":"2026-08-20T07:02:18.389Z","contentChangedAt":"2026-08-20T07:02:18.389Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}