Commit 528c955
fix(objectql): seed reference resolution falls back to matching by id
SeedLoaderService.resolveFromDatabase only matched a reference value against the
target's natural-key field. A seed that wires a lookup to a REAL existing record
by its internal id — e.g. a people field (approver/applicant → user) pointed at
the current user — dangled to null when that id is not a UUID/ObjectId (so the
caller's `looksLikeInternalId` guard did not short-circuit) and is not the
target's natural key.
Add an id fallback: when the natural-key lookup finds nothing, try resolving the
value as the target's `id`. Safe — an id either exists or it doesn't, so there's
no risk of a false natural-key match; and it's tenant-scoped like the primary
lookup.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 593d43b commit 528c955
1 file changed
Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
448 | 448 | | |
449 | 449 | | |
450 | 450 | | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
451 | 470 | | |
452 | 471 | | |
453 | 472 | | |
| |||
0 commit comments