From 888a94ac86ca5115a0693eb4a71fedf2f7bd7e62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Sat, 3 Oct 2026 19:05:26 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E4=BC=9A=E5=91=98):=20=E5=AD=98=E9=87=8F?= =?UTF-8?q?=E5=BA=93=E9=A6=96=E6=AC=A1=E8=AF=BB=E5=8F=96=E8=A1=A5=E7=A7=8D?= =?UTF-8?q?=E4=BC=9A=E5=91=98=E6=A1=A3=E4=BD=8D=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - profile.rs 在 membership_plan_row / membership_plan_records 恢复懒播种,避免增量发布不触发 init reducer 导致 profile_membership_plan 为空。 - 下单校验、升级报价、充值中心读取目录前都会先补种代码内种子目录。 --- .../crates/spacetime-module/src/runtime/active/profile.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server-rs/crates/spacetime-module/src/runtime/active/profile.rs b/server-rs/crates/spacetime-module/src/runtime/active/profile.rs index 708d61f7c..087f1d7c6 100644 --- a/server-rs/crates/spacetime-module/src/runtime/active/profile.rs +++ b/server-rs/crates/spacetime-module/src/runtime/active/profile.rs @@ -9226,6 +9226,8 @@ fn membership_plan_row( ctx: &ReducerContext, plan: RuntimeProfileMembershipPlan, ) -> Option { + // 存量库增量发布不会触发 init reducer;首次读取时懒播种,避免目录为空导致下单 / 报价失败。 + ensure_default_profile_membership_plan(ctx); ctx.db.profile_membership_plan().plan().find(&plan) } @@ -9265,8 +9267,10 @@ fn membership_plan_snapshot( }) } -/// 充值中心与后台共用的目录行读取,按 `rank` 升序;只读,不再触发表为空时的懒播种。 +/// 充值中心与后台共用的目录行读取,按 `rank` 升序;表为空时先补种代码内目录。 fn membership_plan_records(ctx: &ReducerContext) -> Vec { + // 存量库增量发布不会触发 init reducer;首次读取时懒播种,避免充值中心目录为空。 + ensure_default_profile_membership_plan(ctx); let mut rows = ctx.db.profile_membership_plan().iter().collect::>(); rows.sort_by(|left, right| { left.rank