fix(model-catalog): restore rejected rows through the store

with_rejected_replaced still wrote the entries and names fields the store refactor removed, so 02 did not compile. It now inserts the bundled rows in one store edit, which rebuilds the name index

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Yujong Lee 2026-10-28 14:39:03 -07:00 • committed by yujonglee
parent 7c716d5165
commit fb9a261d61

View file

@ -369,22 +369,25 @@ impl Catalog {
rejected.entry(key).or_default().push(error);
}
}
let rejections = rejected
let rejections: Vec<_> = rejected
.into_iter()
.map(|(key, errors)| {
let bundled_entry = bundled.entries.get(&key).cloned();
let replaced_by_bundled = bundled_entry.is_some();
if let Some(entry) = bundled_entry {
catalog.entries.insert(key.clone(), entry);
}
Rejection {
key,
errors,
replaced_by_bundled,
}
.map(|(key, errors)| Rejection {
replaced_by_bundled: bundled.rows().entries.contains_key(&key),
key,
errors,
})
.collect();
catalog.names = name_index(&catalog.entries, &catalog.aliases);
catalog.store.edit(|rows| {
for rejection in rejections
.iter()
.filter(|rejection| rejection.replaced_by_bundled)
{
rows.entries.insert(
rejection.key.clone(),
bundled.rows().entries[&rejection.key].clone(),
);
}
});
(catalog, rejections)
}