Codex worktree snapshot: settings-delete-targeted

Co-authored-by: Codex
This commit is contained in:
kdletters
2026-05-16 22:52:10 +08:00
parent 7f16e88e57
commit 01af298c07
115 changed files with 2831 additions and 1324 deletions

View File

@@ -415,11 +415,9 @@ fn apply_inventory_mutation_tx(
let current_slots = ctx
.db
.inventory_slot()
.iter()
.filter(|slot| {
slot.runtime_session_id == input.runtime_session_id
&& slot.actor_user_id == input.actor_user_id
})
.by_inventory_runtime_session_id()
.filter(&input.runtime_session_id)
.filter(|slot| slot.actor_user_id == input.actor_user_id)
.map(|row| build_inventory_slot_snapshot_from_row(&row))
.collect::<Vec<_>>();
@@ -587,11 +585,9 @@ fn get_runtime_inventory_state_tx(
let slots = ctx
.db
.inventory_slot()
.iter()
.filter(|row| {
row.runtime_session_id == validated_input.runtime_session_id
&& row.actor_user_id == validated_input.actor_user_id
})
.by_inventory_runtime_session_id()
.filter(&validated_input.runtime_session_id)
.filter(|row| row.actor_user_id == validated_input.actor_user_id)
.map(|row| build_inventory_slot_snapshot_from_row(&row))
.collect::<Vec<_>>();
@@ -926,8 +922,8 @@ fn get_story_session_state_tx(
let mut events = ctx
.db
.story_event()
.iter()
.filter(|row| row.story_session_id == input.story_session_id)
.by_story_session_id()
.filter(&input.story_session_id)
.map(|row| build_story_event_snapshot_from_row(&row))
.collect::<Vec<_>>();
events.sort_by_key(|event| (event.created_at_micros, event.event_id.clone()));
@@ -1439,11 +1435,9 @@ fn inventory_reward_source_already_granted(
ctx.db
.inventory_slot()
.iter()
.filter(|row| {
row.runtime_session_id == first_mutation.runtime_session_id
&& row.actor_user_id == first_mutation.actor_user_id
})
.by_inventory_runtime_session_id()
.filter(&first_mutation.runtime_session_id)
.filter(|row| row.actor_user_id == first_mutation.actor_user_id)
.any(|row| row.source_reference_id.as_deref() == Some(source_reference_id))
}