feat(lml-client): add resolveIdentity wrapper (BS#1380 PR 2/5)#1418
Open
jakebromberg wants to merge 1 commit into
Open
feat(lml-client): add resolveIdentity wrapper (BS#1380 PR 2/5)#1418jakebromberg wants to merge 1 commit into
jakebromberg wants to merge 1 commit into
Conversation
…solve (BS#1380 PR 2/5)
Adds `resolveIdentity({kind, source, external_id})` to `@wxyc/lml-client`
for LML#526's `POST /api/v1/identity/resolve` endpoint. Returns a stable
`identity_id` for a release-shaped (source, external_id) pair; idempotent
on the triple — the same triple always returns the same identity_id.
Wrapper layer details:
- Honors `LML_RESOLVE_TIMEOUT_MS` (default 2000 ms) via the shared
`lmlFetch` AbortController. The default budget matches the user-visible
read paths (BS#992 picker budget) — sufficient because every BS consumer
fast-fails to NULL and a daily backfill catches up.
- Wire types defined locally (`ReleaseIdentityResolveRequest` /
`ReleaseIdentityResolveResponse` / `ReleaseIdentityResolveSource`)
mirroring `wxyc-shared/api.yaml`. Same approach used by the original
`EntityResolveResponse` during its ramp-up; types move to
`@wxyc/shared/dtos` once OpenAPI codegen catches up.
- Errors documented exhaustively in the JSDoc so the caller's
classifier (BS#1380 PR 4) maps each bucket cleanly:
* Timeout → LmlClientError 504 (translated by lmlFetch from AbortError)
* 5xx → LmlClientError 502 (translated by lmlFetch)
* 4xx (incl. 422 sentinel rejection) → LmlClientError <status>
* Network → LmlClientError 502 (fetch-threw, distinguished by message)
No consumer in this PR. Consumed by PR 4 (`addToRotation`) and PR 5
(`rotation-lml-identity-backfill` cron). Independent of PR 1 (schema)
— the wrapper has no DB dependency.
Refs #1380
This was referenced Jun 14, 2026
Member
Author
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. Notes verified:
|
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.
Second in a 5-PR chain implementing #1380.
Summary
resolveIdentity({kind, source, external_id})wrapper in@wxyc/lml-clientfor LML#526'sPOST /api/v1/identity/resolve. Idempotent on(source, external_id)— same triple always returns the sameidentity_id.LML_RESOLVE_TIMEOUT_MS(default 2000 ms) viaAbortController. Default matches user-visible read paths (BS#992 picker budget); the BS#1380 plan commits to it in prose. Consumers (PR 4 + PR 5) fast-fail to NULL and the daily backfill catches up.ReleaseIdentityResolveRequest/ReleaseIdentityResolveResponse/ReleaseIdentityResolveSource) mirroringwxyc-shared/api.yaml. Same approach asEntityResolveResponseduring its own ramp-up; types move to@wxyc/shared/dtosonce OpenAPI codegen catches up.Independent of PR 1
This PR has no DB dependency and can land in any order relative to PR 1 (schema). Chained to PR 1 only for sequencing convenience.
Test plan
@wxyc/lml-clientbuild + DTS generationclassifyLmlResolveErrorcover every catch-block branch the wrapper documents)Refs #1380