{"record":{"id":"61f6a2863ea2db5e","repo":"Hmbown/CodeWhale","slug":"offline-queue-schema-v-state-schema-version-is-newer-than","errorCode":null,"errorMessage":"Offline queue schema v{state.schema_version} is newer than supported v{CURRENT_QUEUE_SCHEMA_VERSION}","messagePattern":"Offline queue schema v(.+?) is newer than supported v(.+?)","errorType":"exception","errorClass":"std::io::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/session_manager.rs","lineNumber":2214,"sourceCode":"    }\n\n    fn validated_offline_queue_path(&self, session_id: &str) -> std::io::Result<PathBuf> {\n        let trimmed = self.validated_session_id(session_id)?;\n        Ok(self\n            .checkpoints_dir()\n            .join(format!(\"{trimmed}{OFFLINE_QUEUE_SUFFIX}\")))\n    }\n\n    fn read_offline_queue_file(path: &Path) -> std::io::Result<Option<OfflineQueueState>> {\n        let content = match fs::read_to_string(path) {\n            Ok(content) => content,\n            Err(error) if error.kind() == io::ErrorKind::NotFound => return Ok(None),\n            Err(error) => return Err(error),\n        };\n        let state: OfflineQueueState = serde_json::from_str(&content)\n            .map_err(|e| std::io::Error::new(std::io::ErrorKind::InvalidData, e))?;\n        if state.schema_version > CURRENT_QUEUE_SCHEMA_VERSION {\n            return Err(std::io::Error::new(\n                std::io::ErrorKind::InvalidData,\n                format!(\n                    \"Offline queue schema v{} is newer than supported v{}\",\n                    state.schema_version, CURRENT_QUEUE_SCHEMA_VERSION\n                ),\n            ));\n        }\n        Ok(Some(state))\n    }\n\n    /// Migrate the pre-per-session global queue (`checkpoints/offline_queue.json`).\n    ///\n    /// It holds user-authored text, so it is adopted only by the session it was\n    /// stamped for, and it is removed only once this session's copy is durably\n    /// written. A queue stamped for someone else — or for nobody — is left\n    /// exactly where it is, still readable, for its owner to claim.\n    fn adopt_legacy_offline_queue(\n        &self,","sourceCodeStart":2196,"sourceCodeEnd":2232,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/433685b2024e7bc4c99e1e2e326bcad39b4d9d65/crates/tui/src/session_manager.rs#L2196-L2232","documentation":"After deserializing a parked offline queue, the loader checks `state.schema_version > CURRENT_QUEUE_SCHEMA_VERSION` and rejects newer formats with `io::ErrorKind::InvalidData`. Like the session-schema check, this prevents an older binary from misreading fields written by a newer release.","triggerScenarios":"Loading a parked offline queue whose `schema_version` exceeds the current binary's `CURRENT_QUEUE_SCHEMA_VERSION` — typically after a downgrade or switching to an older branch.","commonSituations":"Rolling the binary back while a queued-input state was parked by a newer version; syncing checkpoint directories between machines running different versions.","solutions":["Upgrade to the build that wrote the queue state.","Start fresh: remove the parked queue file for that session if its contents are no longer needed.","Before downgrading, drain/flush the offline queue in the newer version."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"let v: serde_json::Value = serde_json::from_str(&std::fs::read_to_string(path)?)?;\nif v[\"schema_version\"].as_u64().unwrap_or(0) > CURRENT_QUEUE_SCHEMA_VERSION {\n    eprintln!(\"parked queue too new\");\n}","typeGuard":null,"tryCatchPattern":"match manager.load_offline_queue_state(id) {\n    Err(e) if e.to_string().contains(\"newer than supported\") => {\n        // upgrade binary or discard the parked queue\n    }\n    other => other?,\n}","preventionTips":["Drain the offline queue before downgrading the binary.","Avoid sharing checkpoint dirs between machines with different versions.","Check schema_version before load."],"tags":["io","schema-version","offline-queue","forward-compatibility"],"backgroundTag":"schema-validation-failed","analyzedSha":"433685b2024e7bc4c99e1e2e326bcad39b4d9d65","analyzedAt":"2026-09-15T12:24:24.634Z","contentChangedAt":"2026-09-15T12:24:24.634Z","schemaVersion":2},"datasetVersion":"2026-09-22T06:17:15.046Z"}