Commit 4b7f0b3
authored
fix: ensure lazy types are loaded before reading version in save() paths (#1169)
## Summary
- Add `await modelRegistry.ensureTypeLoaded(type)` before
`modelRegistry.get(type)` in `YamlDefinitionRepository.save()` and
`YamlEvaluatedDefinitionRepository.save()`
- Without this, lazy-registered types (catalog-known but not yet
imported) cause `get()` to return `undefined`, silently persisting a
stale `typeVersion` to disk
- Follows the established fix pattern from `libswamp/models/get.ts:76`
and `validation_service.ts:706`
Closes swamp-club#90 (follow-up to swamp-club#89)
## Test Plan
- [x] `deno check` passes
- [x] `deno lint` passes
- [x] `deno fmt --check` passes
- [x] All 4305 tests pass
- [x] Filed systeminit/swamp-uat#136 for missing UAT coverage of
typeVersion persistence
🤖 Generated with [Claude Code](https://claude.com/claude-code)1 parent b2c9040 commit 4b7f0b3
2 files changed
Lines changed: 2 additions & 0 deletions
File tree
- src/infrastructure/persistence
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
| 250 | + | |
250 | 251 | | |
251 | 252 | | |
252 | 253 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
| 246 | + | |
246 | 247 | | |
247 | 248 | | |
248 | 249 | | |
| |||
0 commit comments