fix: avoid spacetimedb filtered index panics
This commit is contained in:
@@ -696,15 +696,16 @@ fn list_match3d_works_tx(
|
||||
let rows = if input.published_only {
|
||||
ctx.db
|
||||
.match3d_work_profile()
|
||||
.by_match3d_work_publication_status()
|
||||
.filter(&MATCH3D_PUBLICATION_PUBLISHED.to_string())
|
||||
.iter()
|
||||
// 中文注释:列表页优先稳定性,避免二级索引 filter 初始化异常直接打爆模块实例。
|
||||
.filter(|row| row.publication_status == MATCH3D_PUBLICATION_PUBLISHED)
|
||||
.collect::<Vec<_>>()
|
||||
} else {
|
||||
require_non_empty(&input.owner_user_id, "match3d owner_user_id")?;
|
||||
ctx.db
|
||||
.match3d_work_profile()
|
||||
.by_match3d_work_owner_user_id()
|
||||
.filter(&input.owner_user_id)
|
||||
.iter()
|
||||
.filter(|row| row.owner_user_id == input.owner_user_id)
|
||||
.collect::<Vec<_>>()
|
||||
};
|
||||
let mut items = rows
|
||||
|
||||
Reference in New Issue
Block a user