René's URL Explorer Experiment


Title: fix(webapp): two customer-card and impersonation fixes by isshaddad · Pull Request #4571 · triggerdotdev/trigger.dev · GitHub

Open Graph Title: fix(webapp): two customer-card and impersonation fixes by isshaddad · Pull Request #4571 · triggerdotdev/trigger.dev

X Title: fix(webapp): two customer-card and impersonation fixes by isshaddad · Pull Request #4571 · triggerdotdev/trigger.dev

Description: Two unrelated bugs in admin tooling 1. Customer cards 400'd for customers with no external id api/v1/plain/customer-cards validated customer.email and customer.externalId with z.string().optional(). Plain sends these keys as explicit nulls rather than omitting them, and .optional() accepts undefined but rejects null — so the request failed validation before any lookup ran. Customers we don't set an externalId for got a 400 every time; the rest worked, which is why it looked intermittent. email, externalId and thread are now .nullish(). The refine still requires one of email/externalId, and the route's existing email fallback resolves these customers. The schema and a small response helper moved to app/utils/plainCustomerCards.ts so they can be unit-tested without pulling in the db and env modules. Also fixed in the same file: when no user matched, the route returned { cards: [] }. Plain records an integration error for any requested card key it doesn't get back, so a partial response shows up as a broken card rather than a hidden one. Every requested key is now answered, with components: null where there's no data. 2. An admin couldn't switch impersonation target getUserId resolves to the impersonated user id while impersonating — by design, so requireUser answers "who is this request acting as". The impersonation entry points gated on it, so while impersonating a customer user.admin was that customer's flag (false) and starting on a second target silently redirected to /. You had to stop impersonating first. New getRealUser(request, prismaClient?) in session.server.ts resolves the authenticated user, ignoring the impersonation cookie. redirectWithImpersonation gates on it rather than taking a user from the caller, and uses that id for the audit row — which previously would have named the impersonated customer as the actor. Switching straight from one target to another never passes through clearImpersonation, so a STOP for the previous target is now recorded alongside the new START. Without it the audit trail showed two overlapping STARTs with no close. redirectWithImpersonation keeps a verifiedAdmin parameter, used only by test/impersonationConsent.test.ts to supply an admin without a session cookie. No production caller passes it, and its docstring says not to.

Open Graph Description: Two unrelated bugs in admin tooling 1. Customer cards 400'd for customers with no external id api/v1/plain/customer-cards validated customer.email and customer.externalId with z.string().option...

X Description: Two unrelated bugs in admin tooling 1. Customer cards 400'd for customers with no external id api/v1/plain/customer-cards validated customer.email and customer.externalId with z.string().op...

Opengraph URL: https://github.com/triggerdotdev/trigger.dev/pull/4571

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:86c07926-f7fa-f4fa-9ed2-c0c3b8716639
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id8378:346C31:F2BAA:1586D4:6AFAF384
html-safe-noncea4bcbcecb5f2d449290039f0310d20c98d7874e1e9c81794082212c17cdbc739
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4Mzc4OjM0NkMzMTpGMkJBQToxNTg2RDQ6NkFGQUYzODQiLCJ2aXNpdG9yX2lkIjoiNTU5MDM3ODY4ODk1MzM4MTc2NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac49a9aad217d4b1263ead9c06fab601e2cd7a7b2e6ebd7de5c72d8a803b84b8df
hovercard-subject-tagpull_request:4255109539
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/triggerdotdev/trigger.dev/pull/4571/files
twitter:imagehttps://avatars.githubusercontent.com/u/74388823?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/74388823?s=400&v=4
og:image:altTwo unrelated bugs in admin tooling 1. Customer cards 400'd for customers with no external id api/v1/plain/customer-cards validated customer.email and customer.externalId with z.string().option...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None0178036d8230524a18422872393ab7e708443ae4c2047f758560a2db870c1913
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/triggerdotdev/trigger.dev git https://github.com/triggerdotdev/trigger.dev.git
octolytics-dimension-user_id95297378
octolytics-dimension-user_logintriggerdotdev
octolytics-dimension-repository_id572570113
octolytics-dimension-repository_nwotriggerdotdev/trigger.dev
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id572570113
octolytics-dimension-repository_network_root_nwotriggerdotdev/trigger.dev
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasea85e96a83bed7871993e6b1ffda24105928eee17
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/triggerdotdev/trigger.dev/pull/4571/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftriggerdotdev%2Ftrigger.dev%2Fpull%2F4571%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftriggerdotdev%2Ftrigger.dev%2Fpull%2F4571%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=triggerdotdev%2Ftrigger.dev
Reloadhttps://github.com/triggerdotdev/trigger.dev/pull/4571/files
Reloadhttps://github.com/triggerdotdev/trigger.dev/pull/4571/files
Reloadhttps://github.com/triggerdotdev/trigger.dev/pull/4571/files
triggerdotdevhttps://github.com/triggerdotdev
trigger.devhttps://github.com/triggerdotdev/trigger.dev
Codehttps://github.com/triggerdotdev/trigger.dev
Issues203 (203)https://github.com/triggerdotdev/trigger.dev/issues
Pull requests67 (67)https://github.com/triggerdotdev/trigger.dev/pulls
Discussionshttps://github.com/triggerdotdev/trigger.dev/discussions
Actionshttps://github.com/triggerdotdev/trigger.dev/actions
Projectshttps://github.com/triggerdotdev/trigger.dev/projects
Security and quality39 (39)https://github.com/triggerdotdev/trigger.dev/security
Insightshttps://github.com/triggerdotdev/trigger.dev/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Ftriggerdotdev%2Ftrigger.dev%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Ftriggerdotdev%2Ftrigger.dev%2Fissues%2Fnew%2Fchoose
isshaddadhttps://github.com/isshaddad
mainhttps://github.com/triggerdotdev/trigger.dev/tree/main
fix/plain-card-and-impersonation-switchhttps://github.com/triggerdotdev/trigger.dev/tree/fix/plain-card-and-impersonation-switch
Conversation 35 https://github.com/triggerdotdev/trigger.dev/pull/4571
Commits 9 https://github.com/triggerdotdev/trigger.dev/pull/4571/commits
Checks 45 https://github.com/triggerdotdev/trigger.dev/pull/4571/checks
Files changed https://github.com/triggerdotdev/trigger.dev/pull/4571/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4571/files
fix(webapp): two customer-card and impersonation fixes https://github.com/triggerdotdev/trigger.dev/pull/4571/files#top
Show all changes 9 commits https://github.com/triggerdotdev/trigger.dev/pull/4571/files
cb6088c fix(webapp): accept Plain customers without an external id on custome… isshaddad Aug 11, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4571/commits/cb6088cf1fa8a79d73f0238972b77920cc34c3c0
5dc5f70 fix(webapp): let an admin switch impersonation target without stoppin… isshaddad Aug 11, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4571/commits/5dc5f70010467ffe4da0853db0935b44727028e5
6551a58 fix(webapp): scope impersonation to id-matched customers and enforce … isshaddad Aug 11, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4571/commits/6551a587aa3da4da0dbb8438904b8624e4f82c19
3c90ce3 chore(webapp): drop the now-unused requireUser import isshaddad Aug 11, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4571/commits/3c90ce311643c58d39a121a2c73f25e06dcde65c
4aadcd5 fix(webapp): keep the impersonation link through login, order audit rows isshaddad Aug 11, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4571/commits/4aadcd56fdc62ff8409a5afe0ee81a3b9c9a7858
f1c6eb3 fix(webapp): write the impersonation audit pair atomically isshaddad Aug 11, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4571/commits/f1c6eb383007f6fd4a63cde41dcc9aaa7ee76ec0
4f7fc96 fix(webapp): reset the view-as-user flag when switching impersonation… isshaddad Aug 11, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4571/commits/4f7fc9609d7448ea0fe1107e36fec349525bb894
7be4c3b fix(webapp): take the impersonate route out of the admin layout isshaddad Aug 11, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4571/commits/7be4c3bde00f3b635df79423bbc6f54b1531a03d
e5e910b fix(webapp): gate the impersonate route on canSuper, not the admin co… isshaddad Aug 11, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4571/commits/e5e910bd0abd159f125b76098e3fcc20c5648982
Clear filters https://github.com/triggerdotdev/trigger.dev/pull/4571/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4571/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4571/files
admin.server.ts https://github.com/triggerdotdev/trigger.dev/pull/4571/files#diff-8d2b2e02299782414c09715c09e8f6d8b735138e699e5b05d574bde159e6c420
_app.@.orgs.$organizationSlug.$.tsx https://github.com/triggerdotdev/trigger.dev/pull/4571/files#diff-a35fa02418311030f2c2d2cc5b33b7bd4661110924f122f236538b3747645295
admin.impersonate.tsx https://github.com/triggerdotdev/trigger.dev/pull/4571/files#diff-4044ef607a1260f8d0d089b964f9627772e6894a57e2b14a1c676cb5ac757bf1
admin_.impersonate.tsx https://github.com/triggerdotdev/trigger.dev/pull/4571/files#diff-0831fd50d8eb06cf4e58e534a919dc6d8b1f5c32d122274804bfe247bdbcc3e2
api.v1.plain.customer-cards.ts https://github.com/triggerdotdev/trigger.dev/pull/4571/files#diff-9cabdbddbef6674ed0b379d8f795e54b121c0dbabe025e99cdf8d738a0d0ffbb
impersonation.server.ts https://github.com/triggerdotdev/trigger.dev/pull/4571/files#diff-bbb056cb93bc10685a2100d2258a5bfad7cfce2b78acdd597e9013140be84912
session.server.ts https://github.com/triggerdotdev/trigger.dev/pull/4571/files#diff-29ba17ba87f7943e0d20fa2c2a3daa2cfd697e8daba40e37d99d76903afd5b8e
plainCustomerCards.test.ts https://github.com/triggerdotdev/trigger.dev/pull/4571/files#diff-62c4b97f4be53e16c6034a3007e7baabcc4fc221aa0ed88e8562a15ff2c219f1
plainCustomerCards.ts https://github.com/triggerdotdev/trigger.dev/pull/4571/files#diff-25836046fbf9ffe5bc4a43e49b3715999fdb635aaf165ff5a5c4dd0df1c7ae62
apps/webapp/app/models/admin.server.tshttps://github.com/triggerdotdev/trigger.dev/pull/4571/files#diff-8d2b2e02299782414c09715c09e8f6d8b735138e699e5b05d574bde159e6c420
View file https://github.com/triggerdotdev/trigger.dev/blob/e5e910bd0abd159f125b76098e3fcc20c5648982/apps/webapp/app/models/admin.server.ts
Open in desktop https://desktop.github.com
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4571/files
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/4571/{{ revealButtonHref }}
https://github.com/triggerdotdev/trigger.dev/pull/4571/files#diff-8d2b2e02299782414c09715c09e8f6d8b735138e699e5b05d574bde159e6c420
https://github.com/triggerdotdev/trigger.dev/pull/4571/files#diff-8d2b2e02299782414c09715c09e8f6d8b735138e699e5b05d574bde159e6c420
https://github.com/triggerdotdev/trigger.dev/pull/4571/files#diff-8d2b2e02299782414c09715c09e8f6d8b735138e699e5b05d574bde159e6c420
devin-ai-integrationhttps://github.com/apps/devin-ai-integration
Aug 11, 2026https://github.com/triggerdotdev/trigger.dev/pull/4571/files#r3761996429
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
https://app.devin.ai/review/triggerdotdev/trigger.dev/pull/4571
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4571/files
devin-ai-integrationhttps://github.com/apps/devin-ai-integration
Aug 11, 2026https://github.com/triggerdotdev/trigger.dev/pull/4571/files#r3762054384
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
https://app.devin.ai/review/triggerdotdev/trigger.dev/pull/4571
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4571/files
https://github.com/triggerdotdev/trigger.dev/pull/4571/files#diff-8d2b2e02299782414c09715c09e8f6d8b735138e699e5b05d574bde159e6c420
https://github.com/triggerdotdev/trigger.dev/pull/4571/files#diff-8d2b2e02299782414c09715c09e8f6d8b735138e699e5b05d574bde159e6c420
https://github.com/triggerdotdev/trigger.dev/pull/4571/files#diff-8d2b2e02299782414c09715c09e8f6d8b735138e699e5b05d574bde159e6c420
https://github.com/triggerdotdev/trigger.dev/pull/4571/files#diff-8d2b2e02299782414c09715c09e8f6d8b735138e699e5b05d574bde159e6c420
apps/webapp/app/routes/_app.@.orgs.$organizationSlug.$.tsxhttps://github.com/triggerdotdev/trigger.dev/pull/4571/files#diff-a35fa02418311030f2c2d2cc5b33b7bd4661110924f122f236538b3747645295
View file https://github.com/triggerdotdev/trigger.dev/blob/e5e910bd0abd159f125b76098e3fcc20c5648982/apps/webapp/app/routes/_app.%40.orgs.%24organizationSlug.%24.tsx
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/4571/{{ revealButtonHref }}
https://github.com/triggerdotdev/trigger.dev/pull/4571/files#diff-a35fa02418311030f2c2d2cc5b33b7bd4661110924f122f236538b3747645295
devin-ai-integrationhttps://github.com/apps/devin-ai-integration
Aug 11, 2026https://github.com/triggerdotdev/trigger.dev/pull/4571/files#r3760583064
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4571/files
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
https://app.devin.ai/review/triggerdotdev/trigger.dev/pull/4571
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4571/files
isshaddadhttps://github.com/isshaddad
Aug 11, 2026https://github.com/triggerdotdev/trigger.dev/pull/4571/files#r3761981319
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4571/files
https://github.com/triggerdotdev/trigger.dev/pull/4571/files#diff-a35fa02418311030f2c2d2cc5b33b7bd4661110924f122f236538b3747645295
https://github.com/triggerdotdev/trigger.dev/pull/4571/files#diff-a35fa02418311030f2c2d2cc5b33b7bd4661110924f122f236538b3747645295
https://github.com/triggerdotdev/trigger.dev/pull/4571/files#diff-a35fa02418311030f2c2d2cc5b33b7bd4661110924f122f236538b3747645295
apps/webapp/app/routes/admin.impersonate.tsxhttps://github.com/triggerdotdev/trigger.dev/pull/4571/files#diff-4044ef607a1260f8d0d089b964f9627772e6894a57e2b14a1c676cb5ac757bf1
View file https://github.com/triggerdotdev/trigger.dev/blob/8819e25751e2ae6ee90002c7110c3f838df24dab/apps/webapp/app/routes/admin.impersonate.tsx
Open in desktop https://desktop.github.com
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4571/files
apps/webapp/app/routes/admin_.impersonate.tsxhttps://github.com/triggerdotdev/trigger.dev/pull/4571/files#diff-0831fd50d8eb06cf4e58e534a919dc6d8b1f5c32d122274804bfe247bdbcc3e2
View file https://github.com/triggerdotdev/trigger.dev/blob/e5e910bd0abd159f125b76098e3fcc20c5648982/apps/webapp/app/routes/admin_.impersonate.tsx
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/4571/{{ revealButtonHref }}
devin-ai-integrationhttps://github.com/apps/devin-ai-integration
Aug 11, 2026https://github.com/triggerdotdev/trigger.dev/pull/4571/files#r3761996546
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4571/files
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
https://app.devin.ai/review/triggerdotdev/trigger.dev/pull/4571
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4571/files
isshaddadhttps://github.com/isshaddad
Aug 11, 2026https://github.com/triggerdotdev/trigger.dev/pull/4571/files#r3762032131
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4571/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4571/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4571/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.