fix(resolver): flip stale lowercase test literal + JSDoc to UPPER#130
Merged
sroussey merged 1 commit intoJun 8, 2026
Merged
Conversation
PR #129 pinned FamilyResolver normalization to UPPER but two callers were missed: - Form_S_1.storage.underwriters.test.ts: findByResolverAndName lookup still used "goldman sachs", returning undefined and crashing the next line's family! dereference. Updated to "GOLDMAN SACHS" to match the three other test files already flipped in PR #129. - SponsorFamilyResolver.normalizeSponsorFamilyName JSDoc still described lower-casing; the function delegates to normalizeFamilyName which now UPPER-cases. Updated the doc to reflect actual behavior and the canonical_sponsor_family.normalized_name column it matches against. UnderwriterFamilyResolver was checked and has no equivalent stale doc.
sroussey
added a commit
that referenced
this pull request
Jun 8, 2026
…lization (#129) * fix(resolver): serialize alias lookup inside per-key mutex for FamilyResolver The shared FamilyResolver acquired the per-key mutex, ran find-or-create, released, then ran resolveAlias() OUTSIDE the lock. Two parallel resolve() calls on the same family name could split if an alias was installed between the create and the alias-lookup — one returned the alias target, the other the pre-alias id. This is the same race PR #127 fixed for PersonResolver and CompanyResolver in commit 8fe6fd0; applying the same fix here so SponsorFamilyResolver and UnderwriterFamilyResolver benefit. Adds regression tests in both family-resolver test files that wrap aliasRepo.resolve with an in-flight counter and assert maxInFlight === 1 under two parallel resolves on the same key (pre-fix code drives it to 2). * fix(resolver): pin FamilyResolver normalize-case to UPPER; lock in via FamilyResolver.test.ts The shared normalizeFamilyName introduced in commit 960d707 silently flipped the family-name fold from UPPER (the pre-refactor SponsorFamilyResolver convention) to lower. CanonicalSponsorFamilyRepo.findByResolverAndName runs an exact-match storage query with no case fold, so any existing UPPER canonical_sponsor_family.normalized_name rows became unreachable, and operator-installed aliases keyed on those canonical ids would silently orphan. Reverts the fold to UPPER and pins it via a new dedicated FamilyResolver.test.ts that covers UPPER output, case-insensitivity, internal-whitespace collapse, and empty/whitespace-only input. Also updates three test fixtures (CanonicalSponsorFamilyRepo, CanonicalUnderwriterFamilyRepo, underwriterFamily command tests) that hardcoded lowercase normalized_name literals so they match the live convention. * fix(resolver): flip stale lowercase test literal + JSDoc to UPPER (#130) PR #129 pinned FamilyResolver normalization to UPPER but two callers were missed: - Form_S_1.storage.underwriters.test.ts: findByResolverAndName lookup still used "goldman sachs", returning undefined and crashing the next line's family! dereference. Updated to "GOLDMAN SACHS" to match the three other test files already flipped in PR #129. - SponsorFamilyResolver.normalizeSponsorFamilyName JSDoc still described lower-casing; the function delegates to normalizeFamilyName which now UPPER-cases. Updated the doc to reflect actual behavior and the canonical_sponsor_family.normalized_name column it matches against. UnderwriterFamilyResolver was checked and has no equivalent stale doc. Co-authored-by: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two follow-up fixes to #129, which pinned
FamilyResolvernormalization to UPPER:Form_S_1.storage.underwriters.test.ts:67still calledfindByResolverAndName("1.0.0", "goldman sachs"). Under the UPPER normalization it returnsundefined, and the next line dereferencesfamily!.canonical_underwriter_family_idand crashes. Flipped the literal to"GOLDMAN SACHS"to match the three other test files already updated in fix(resolver): FamilyResolver — alias inside mutex + UPPER case-normalization #129.SponsorFamilyResolver.normalizeSponsorFamilyName's JSDoc still described "then lower-casing for case-insensitive matching". The function delegates tonormalizeFamilyName, which now UPPER-cases. Updated the doc to describe UPPER-casing and thecanonical_sponsor_family.normalized_namecolumn it matches against.UnderwriterFamilyResolverwas checked and has no equivalent stale doc.Test plan
bun test src/sec/forms/registration-statements/Form_S_1.storage.underwriters.test.ts src/resolver/SponsorFamilyResolver.test.ts src/resolver/UnderwriterFamilyResolver.test.ts src/resolver/FamilyResolver.test.ts— 11 pass / 0 failbun run build-types— cleangrep -i 'lower-cas\|lowercas\|lower case' src/resolver/— no remaining stale refshttps://claude.ai/code/session_0198SNs3pRmADdpeWrGZv9UB
Generated by Claude Code