Skip to content

Commit ce46c8d

Browse files
committed
fix: only count preview branches toward the preview branch limit
The Limits page counted development branches toward the preview-branch limit, showing inflated and sometimes over-limit values. Filter the count on type PREVIEW with a parent environment to mirror checkBranchLimit. Closes #4281
1 parent 2856662 commit ce46c8d

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
area: webapp
3+
type: fix
4+
---
5+
6+
The "Preview branches" usage on the Limits page now counts only preview branches, so it no longer includes development branches or show over-limit values.

apps/webapp/app/presenters/v3/LimitsPresenter.server.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,14 @@ export class LimitsPresenter extends BasePresenter {
151151
},
152152
});
153153

154-
// Get active branches count for this org (uses @@index([organizationId]))
154+
// Get active preview branches count for this org (uses @@index([organizationId]))
155+
// Mirror checkBranchLimit: only PREVIEW branches (exclude the branchable parent).
156+
// DEVELOPMENT branches have a separate limit and must not be counted here.
155157
const activeBranchCount = await this._replica.runtimeEnvironment.count({
156158
where: {
157159
projectId,
158-
branchName: {
160+
type: "PREVIEW",
161+
parentEnvironmentId: {
159162
not: null,
160163
},
161164
archivedAt: null,

0 commit comments

Comments
 (0)