Repository navigation
fix(certification): credential recipient no longer becomes "undefined undefined" - #4768
Merged
Merged
Conversation
…fined undefined"
When a learner earns a credential before WorkOS has populated their
first_name/last_name, naive `${first} ${last}` interpolation sent the
literal string "undefined undefined" to Certifier (escalation #382,
Tom Hespos). The existing `.trim() || email` fallback in the backfill
path didn't catch it either, because "undefined undefined".trim() is
still truthy.
- Introduce `buildRecipientName({first_name?, last_name?, email})` that
trims each field independently and falls back to email when both are
missing/empty.
- Use it in both issuance call sites: Addie's `issueCertifierBadge`
and the admin backfill route.
- Add `updateCredential(id, {recipient,...})` wrapping Certifier
PATCH /credentials/{id} for after-the-fact corrections.
- Add `server/src/scripts/repair-credential-recipient-names.ts` —
dry-run audit + repair script that finds credentials with
"undefined"/"null" in the remote name (and email-only fallbacks
that now have real name data to substitute) and PATCHes Certifier.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Server-only bugfix, no published package version change needed. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…o 10m
The 5-minute step timeout on `check:owned-links` is too tight when
agenticadvertising.org is slow — multiple unrelated branches started
hitting the 5m wall this morning while main passes in <10s when the
site is healthy. Two surgical fixes:
- Filter URLs containing `{` or `}` in `check-owned-links.js`. These
are documentation placeholders like `/agents/{url-encoded-agent-url}/badge`
that never resolve to a real route; the script was burning the full
per-URL retry budget (3 retries × 10s × HEAD+GET) on guaranteed
timeouts.
- Bump the workflow step timeout from 5 to 10 minutes so a slow-but-
healthy upstream doesn't tip the job over.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
This was referenced May 19, 2026
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
buildRecipientName({first_name?, last_name?, email})helper that trims each field and falls back to email when both are missing. Used by Addie'sissueCertifierBadgeand the admin backfill route — both previously sent the literal"undefined undefined"to Certifier when WorkOS hadn't yet populated a learner's name (escalation Fix duplicate migration version 039 and add CI check #382, Tom Hespos, https://credsverse.com/credentials/ad5e1781-4f45-4162-b457-6ce3627383aa).updateCredential(id, {recipient,...})wrapping CertifierPATCH /credentials/{id}so we can correct names after the fact.server/src/scripts/repair-credential-recipient-names.ts— dry-run audit + repair. Joinsuser_credentials → users, GETs each credential from Certifier, plans a PATCH when the remote name contains"undefined"/"null"or is an email-fallback that we now have real name data to upgrade. Supports--credential-id=and--workos-user-id=filters.Why the existing fallback didn't catch it
routes/certification.tshad\${first} ${last}`.trim() || email, but"undefined undefined".trim()` is still truthy, so the email-fallback never fired.Test plan
tests/unit/certifier-recipient-name.test.ts— 8 cases incl. explicit "never returns the literal 'undefined undefined'" guardnpx tsc --noEmitcleanfly ssh console -a adcp-docs -C 'node /app/dist/scripts/repair-credential-recipient-names.js'--applyonce Tom's record is visible in the plan🤖 Generated with Claude Code