mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-13 21:01:21 +08:00
<!-- Make sure you've read the CONTRIBUTING.md guidelines: https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md --> <!-- RECURSEML_SUMMARY:START --> ## High-level PR Summary This PR adds a developer-friendly error guard to prevent a common mistake where developers try to destructure the user object from `getUser()` or `useUser()` calls (e.g., `const { user } = await app.getUser()`), when the method already returns the user object directly. The fix implements a property getter that throws a helpful error message, attaches it to all user objects (client-side `CurrentUser`, server-side `ServerUser`, and `ServerTeamUser`), and includes E2E tests to verify the behavior. Additionally, it fixes a typo in the Convex example and addresses seed script execution issues. ⏱️ Estimated Review Time: 5-15 minutes <details> <summary>💡 Review Order Suggestion</summary> | Order | File Path | |-------|-----------| | 1 | `packages/template/src/lib/stack-app/users/index.ts` | | 2 | `packages/template/src/lib/stack-app/apps/implementations/client-app-impl.ts` | | 3 | `packages/template/src/lib/stack-app/apps/implementations/server-app-impl.ts` | | 4 | `apps/e2e/tests/js/app.test.ts` | | 5 | `examples/convex/convex/myFunctions.ts` | | 6 | `apps/backend/prisma/seed.ts` | | 7 | `.github/workflows/check-prisma-migrations.yaml` | </details> <details> <summary>⚠️ Inconsistent Changes Detected</summary> | File Path | Warning | |-----------|---------| | `.github/workflows/check-prisma-migrations.yaml` | Adds database cleanup step for auto-migration metadata in CI workflow, which appears unrelated to the main purpose of adding a user getter error guard | | `apps/backend/prisma/seed.ts` | Restructures the seed script execution logic and removes the main module check handler, which seems unrelated to the user getter error fix | </details> [](https://discord.gg/n3SsVDAW6U) [![Analyze latest changes]( |
||
|---|---|---|
| .. | ||
| tests | ||
| .env | ||
| .env.development | ||
| .eslintrc.cjs | ||
| CHANGELOG.md | ||
| LICENSE | ||
| package.json | ||
| tsconfig.json | ||
| vitest.config.ts | ||