[Release] cli template + api key mode dash + user fallback #680
[Release] cli template + api key mode dash + user fallback #680rsproule merged 14 commits intoproductionfrom
Conversation
feat: echo cli template
keep .env.local + rm pnpm artifacts
ref: API key and transaction count queries
fix user display
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
|
🚅 Deployed to the echo-pr-680 environment in echo
|
| {transaction.user?.name ?? 'x402 Users'} | ||
| {transaction.user?.name ?? | ||
| (transaction.user?.email | ||
| ? `${transaction.user.id}` |
There was a problem hiding this comment.
When a transaction has no name but has an email, the code tries to display the user's ID. However, the ID can be null according to the type definition, which will display the string "null" to users instead of a proper fallback.
View Details
📝 Patch Details
diff --git a/packages/app/control/src/app/(app)/app/[id]/transactions/_components/transactions.tsx b/packages/app/control/src/app/(app)/app/[id]/transactions/_components/transactions.tsx
index 976abde3..846ca909 100644
--- a/packages/app/control/src/app/(app)/app/[id]/transactions/_components/transactions.tsx
+++ b/packages/app/control/src/app/(app)/app/[id]/transactions/_components/transactions.tsx
@@ -114,7 +114,7 @@ const TransactionRow = ({ transaction }: { transaction: Transaction }) => {
<span className="font-medium">
{transaction.user?.name ??
(transaction.user?.email
- ? `${transaction.user.id}`
+ ? transaction.user.id ?? 'x402 Users'
: 'Unknown User')}
</span>{' '}
made {transaction.callCount} requests
diff --git a/packages/app/control/src/app/(app)/app/[id]/users/_components/users.tsx b/packages/app/control/src/app/(app)/app/[id]/users/_components/users.tsx
index 96a7ea86..9f340423 100644
--- a/packages/app/control/src/app/(app)/app/[id]/users/_components/users.tsx
+++ b/packages/app/control/src/app/(app)/app/[id]/users/_components/users.tsx
@@ -188,7 +188,7 @@ const UserRow = ({ user, showEmail }: { user: User; showEmail: boolean }) => {
<div className="flex flex-row items-center gap-2">
<UserAvatar src={user.image} className="size-6" />
<p className="text-sm font-medium">
- {user.name ?? (user.email ? `${user.id}` : 'Unknown User')}
+ {user.name ?? (user.email ? user.id ?? 'Unknown User' : 'Unknown User')}
</p>
</div>
</TableCell>
Analysis
Null user.id displays "null" string in transaction and user lists
What fails: TransactionRow component in transactions.tsx (line 116) and UserRow component in users.tsx (line 191) display the literal string "null" when user.id is null but user.email exists
How to reproduce:
// Transaction with null userId but valid email triggers the bug
const transaction = {
user: { id: null, name: null, email: 'user@example.com' }
};
// Template literal ` Result: Users see "null made 5 requests" instead of a proper fallback like "x402 Users made 5 requests"
Expected: Should show meaningful fallback text per database schema (Transaction.userId is nullable String?) and backend service pattern (sets name to 'x402 Users' when userId is null)
No description provided.