feat: Add settings in tanstack start - #768
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3f37ce58bc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| * Exported as the invalidation target too - there is exactly one entry, so the | ||
| * key and the family are the same value. | ||
| */ | ||
| export const DEVICES_QUERY_KEY = ["devices", "me"] as const; |
There was a problem hiding this comment.
Invalidate device data when the session changes
When two users sign in sequentially in the same browser tab, this user-independent key retains the first user's device list after sign-out because useSignOutAction only invalidates the session query. On the second user's visit, the route loader uses ensureQueryData, which accepts the existing entry, while the configured refetchOnMount: false prevents the component from correcting it; the page therefore exposes the previous user's device names, IP addresses, and timestamps. Remove this identity-scoped entry on sign-out/authentication changes or include the authenticated user identity in its key.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 50f5bf134e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| name: z | ||
| .string({ message: fieldRequired }) | ||
| .min(3, nameMinLength) | ||
| .max(32, nameMaxLength) | ||
| .default(""), |
There was a problem hiding this comment.
Validate usernames before invoking the server function
When a visitor enters a username containing an API-forbidden character or doubled spaces (for example, O'Connor or John Doe), this form schema accepts it, but the new signUpInputSchema rejects it in the createServerFn validator. That rejection occurs before signUpOnApi can return the closed invalid result, and useSignUpForm does not catch it, so the TanStack registration form submits successfully from the UI and then provides neither a field error nor the intended failure toast. Apply the API's username refinement in this form schema so the error remains actionable.
Useful? React with 👍 / 👎.
| const config = await context.queryClient.ensureQueryData( | ||
| middlewareConfigQueryOptions(), | ||
| ) |
There was a problem hiding this comment.
Refetch stale configuration before deciding recovery availability
When this tab previously cached middleware configuration—especially UNKNOWN_MIDDLEWARE_CONFIG during a transient outage—ensureQueryData returns that cached value without checking whether it is stale. Since VitNode also disables refetchOnMount, retrying this route after the API recovers can continue throwing PasswordRecoveryUnknownError indefinitely while the previous auth page keeps the query alive; similarly, enabling email recovery on a deployment can leave this route returning 404 past the configured five-minute stale time. Read through fetchQuery here and make unknown fallback entries immediately retryable.
Useful? React with 👍 / 👎.
Improving Documentation
pnpm lint:fixto fix formatting issues before opening the PR.Description
What?
Why?