From 3ab7b386f17dc6142fc4abfeebf8eacd231dfd0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Tue, 22 Sep 2026 16:52:19 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=A4=96=E9=83=A8=E7=94=9F=E6=88=90?= =?UTF-8?q?=E4=B8=BB=E8=A1=A8=20provider=20checkpoint=20=E5=BD=92=E4=B8=80?= =?UTF-8?q?=E5=8C=96=E5=8D=95=E6=B5=8B=20-=20=E6=96=B0=E5=A2=9E=20old=5Fex?= =?UTF-8?q?ternal=5Fgeneration=5Fjob=5Frows=5Fdefault=5Fto=5Funsubmitted?= =?UTF-8?q?=5Fprovider=20-=20=E6=96=AD=E8=A8=80=E6=97=A7=E8=BF=81=E7=A7=BB?= =?UTF-8?q?=E8=A1=8C=E7=9A=84=20provider=5Fkind=20=E4=B8=8E=20provider=5Ft?= =?UTF-8?q?ask=5Fid=20=E9=83=BD=E5=BD=92=E4=B8=80=E6=88=90=20null=20-=20?= =?UTF-8?q?=E5=AE=88=E4=BD=8F=20at-most-once=20submit=20=E7=9A=84=E5=90=91?= =?UTF-8?q?=E5=90=8E=E5=85=BC=E5=AE=B9=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server-rs/crates/spacetime-module/src/migration.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/server-rs/crates/spacetime-module/src/migration.rs b/server-rs/crates/spacetime-module/src/migration.rs index 62b5e11f7..c3e4605a5 100644 --- a/server-rs/crates/spacetime-module/src/migration.rs +++ b/server-rs/crates/spacetime-module/src/migration.rs @@ -1938,6 +1938,19 @@ mod migration_bootstrap_secret_tests { assert_eq!(normalized["warning_message"], serde_json::Value::Null); } + /// 旧迁移包的 external_generation_job 没有 provider checkpoint 两列:导入后必须都是 + /// null(等同 `#[default(None)]`),否则 at-most-once submit 会把旧任务误判成已提交。 + #[test] + fn old_external_generation_job_rows_default_to_unsubmitted_provider() { + let normalized = normalize_migration_row( + "external_generation_job", + &serde_json::json!({ "job_id": "task-1" }), + ); + + assert_eq!(normalized["provider_kind"], serde_json::Value::Null); + assert_eq!(normalized["provider_task_id"], serde_json::Value::Null); + } + #[test] fn old_editor_canvas_rows_default_to_legacy_storage() { let normalized = normalize_migration_row(