Reject a checkpoint written by a *newer*, incompatible schema version than this build understands — mirrors [`LoopCheckpoint::ensure_loadable`](crate::loop_checkpoint::LoopCheckpoint::ensure_loadable). Field additions are absorbed by `#[serde(default)]`, so older (incl. pre-v1 `0`) checkpoints always remain loadable.
(&self)
| 78 | /// Field additions are absorbed by `#[serde(default)]`, so older (incl. |
| 79 | /// pre-v1 `0`) checkpoints always remain loadable. |
| 80 | pub fn ensure_loadable(&self) -> anyhow::Result<()> { |
| 81 | if self.schema_version > WORKFLOW_CHECKPOINT_SCHEMA_VERSION { |
| 82 | anyhow::bail!( |
| 83 | "workflow checkpoint {} has schema version {} but this build supports at \ |
| 84 | most {}; refusing to resume from an incompatible future checkpoint", |
| 85 | self.workflow_id, |
| 86 | self.schema_version, |
| 87 | WORKFLOW_CHECKPOINT_SCHEMA_VERSION |
| 88 | ); |
| 89 | } |
| 90 | Ok(()) |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | #[cfg(test)] |
no outgoing calls