fix: stabilize admin tracking event display
This commit is contained in:
@@ -491,7 +491,30 @@ pub fn query_analytics_metric(
|
||||
}
|
||||
}
|
||||
|
||||
// 任务中心读取会顺手记录当日登录埋点,确保“每日登录”只依赖后端事实。
|
||||
// 登录成功埋点由认证链路主动调用;任务中心只负责读取和刷新任务进度。
|
||||
#[spacetimedb::procedure]
|
||||
pub fn record_daily_login_tracking_event_and_return(
|
||||
ctx: &mut ProcedureContext,
|
||||
input: RuntimeProfileTaskCenterGetInput,
|
||||
) -> RuntimeTrackingEventProcedureResult {
|
||||
match ctx.try_with_tx(|tx| {
|
||||
let validated_input = build_runtime_profile_task_center_get_input(input.user_id)
|
||||
.map_err(|error| error.to_string())?;
|
||||
ensure_default_profile_task_config(tx);
|
||||
record_daily_login_tracking_event(tx, &validated_input.user_id)
|
||||
}) {
|
||||
Ok(()) => RuntimeTrackingEventProcedureResult {
|
||||
ok: true,
|
||||
error_message: None,
|
||||
},
|
||||
Err(message) => RuntimeTrackingEventProcedureResult {
|
||||
ok: false,
|
||||
error_message: Some(message),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// 任务中心读取会刷新进度;每日登录埋点应由登录成功链路提前记录。
|
||||
#[spacetimedb::procedure]
|
||||
pub fn get_profile_task_center(
|
||||
ctx: &mut ProcedureContext,
|
||||
|
||||
Reference in New Issue
Block a user