[PR #5893] [MERGED] pref: infinite tsc compilation time #23203

Closed
opened 2026-04-15 21:32:54 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/5893
Author: @himself65
Created: 11/11/2025
Status: Merged
Merged: 11/11/2025
Merged by: @himself65

Base: canaryHead: himself65/2025/11/10/fix


📝 Commits (6)

📊 Changes

4 files changed (+78 additions, -41 deletions)

View changed files

📝 e2e/smoke/test/typecheck.spec.ts (+7 -7)
📝 packages/better-auth/src/plugins/organization/organization.test.ts (+1 -1)
📝 packages/better-auth/src/plugins/organization/organization.ts (+63 -20)
📝 packages/better-auth/src/plugins/organization/routes/crud-org.ts (+7 -13)

📄 Description

This PR causes TSC to experience infinite compilation time. https://github.com/better-auth/better-auth/pull/3731


Summary by cubic

Fixes an infinite TypeScript compile hang in the organization plugin by simplifying conditional types and removing recursive type computations. Restores normal tsc times while keeping accurate team-related types.

  • Bug Fixes
    • Replaced ActiveOrganization’s nested Awaited/ReturnType recursion with a direct conditional object shape based on teams.enabled.
    • Imported and used InferTeam; included teams in ActiveOrganization only when teams are enabled.
    • Set Team and TeamMember fallbacks to unknown when teams are disabled.
    • Enabled all typecheck fixtures and added a 10s timeout to prevent hangs.

Written for commit 376154dc75. Summary will update automatically on new commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/5893 **Author:** [@himself65](https://github.com/himself65) **Created:** 11/11/2025 **Status:** ✅ Merged **Merged:** 11/11/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `himself65/2025/11/10/fix` --- ### 📝 Commits (6) - [`c80cf60`](https://github.com/better-auth/better-auth/commit/c80cf60198625957a62336f0ddd8ff18a86dc29c) pref: infinite `tsc` compilation time - [`382ca3c`](https://github.com/better-auth/better-auth/commit/382ca3c7b04fdee1d466b0693f48a9ff97fec73b) test: 10s - [`c332ba0`](https://github.com/better-auth/better-auth/commit/c332ba092afa707db31392df8d3716de71196d0c) ci: fix - [`a14dff2`](https://github.com/better-auth/better-auth/commit/a14dff21c8ec5026bb71d77296571ba7d34712c6) fix: more - [`ba5914d`](https://github.com/better-auth/better-auth/commit/ba5914d0f702e1d52aaa6baf4b4c5da64baf2647) fix: type - [`376154d`](https://github.com/better-auth/better-auth/commit/376154dc75a21a6404a6b3cba5c5aaceb3f5f380) type fix ### 📊 Changes **4 files changed** (+78 additions, -41 deletions) <details> <summary>View changed files</summary> 📝 `e2e/smoke/test/typecheck.spec.ts` (+7 -7) 📝 `packages/better-auth/src/plugins/organization/organization.test.ts` (+1 -1) 📝 `packages/better-auth/src/plugins/organization/organization.ts` (+63 -20) 📝 `packages/better-auth/src/plugins/organization/routes/crud-org.ts` (+7 -13) </details> ### 📄 Description This PR causes TSC to experience infinite compilation time. https://github.com/better-auth/better-auth/pull/3731 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fixes an infinite TypeScript compile hang in the organization plugin by simplifying conditional types and removing recursive type computations. Restores normal tsc times while keeping accurate team-related types. - **Bug Fixes** - Replaced ActiveOrganization’s nested Awaited/ReturnType recursion with a direct conditional object shape based on teams.enabled. - Imported and used InferTeam; included teams in ActiveOrganization only when teams are enabled. - Set Team and TeamMember fallbacks to unknown when teams are disabled. - Enabled all typecheck fixtures and added a 10s timeout to prevent hangs. <sup>Written for commit 376154dc75a21a6404a6b3cba5c5aaceb3f5f380. Summary will update automatically on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-15 21:32:54 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#23203