Skip to content

SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.

task(licenses): update the license events and the state names (#7034)

Vikrant Gupta2b32ce190fef
diff --git a/ee/query-service/model/license.go b/ee/query-service/model/license.go
index b96f6737a3..e66a2f1bb6 100644
--- a/ee/query-service/model/license.go
+++ b/ee/query-service/model/license.go
@@ -139,8 +139,8 @@ func NewLicenseV3(data map[string]interface{}) (*LicenseV3, error) {
if err != nil {
return nil, err
}
- // if license status is inactive then default it to basic
- if status == LicenseStatusInactive {
+ // if license status is invalid then default it to basic
+ if status == LicenseStatusInvalid {
planName = PlanNameBasic
}
diff --git a/ee/query-service/model/plans.go b/ee/query-service/model/plans.go
index cb9760180b..6dbfa8ba56 100644
--- a/ee/query-service/model/plans.go
+++ b/ee/query-service/model/plans.go
@@ -21,7 +21,7 @@ var (
)
var (
- LicenseStatusInactive = "INACTIVE"
+ LicenseStatusInvalid = "INVALID"
)
const DisableUpsell = "DISABLE_UPSELL"
diff --git a/frontend/src/AppRoutes/Private.tsx b/frontend/src/AppRoutes/Private.tsx
index 162ca5de6b..87ad2bcc3a 100644
--- a/frontend/src/AppRoutes/Private.tsx
+++ b/frontend/src/AppRoutes/Private.tsx
@@ -156,7 +156,7 @@ function PrivateRoute({ children }: PrivateRouteProps): JSX.Element {
const currentRoute = mapRoutes.get('current');
const shouldSuspendWorkspace =
activeLicenseV3.status === LicenseStatus.SUSPENDED &&
- activeLicenseV3.state === LicenseState.PAYMENT_FAILED;
+ activeLicenseV3.state === LicenseState.DEFAULTED;
if (shouldSuspendWorkspace && currentRoute) {
navigateToWorkSpaceSuspended(currentRoute);
diff --git a/frontend/src/container/AppLayout/index.tsx b/frontend/src/container/AppLayout/index.tsx
index 78f8fa1564..ab73a3fbb7 100644
--- a/frontend/src/container/AppLayout/index.tsx
+++ b/frontend/src/container/AppLayout/index.tsx
@@ -250,7 +250,7 @@ function AppLayout(props: AppLayoutProps): JSX.Element {
if (
!isFetchingActiveLicenseV3 &&
!isNull(activeLicenseV3) &&
- activeLicenseV3?.event_queue?.event === LicenseEvent.FAILED_PAYMENT
+ activeLicenseV3?.event_queue?.event === LicenseEvent.DEFAULT
) {
setShowPaymentFailedWarning(true);
}
diff --git a/frontend/src/pages/WorkspaceSuspended/WorkspaceSuspended.tsx b/frontend/src/pages/WorkspaceSuspended/WorkspaceSuspended.tsx
index ed8894ffe7..e4dd11dc0b 100644
--- a/frontend/src/pages/WorkspaceSuspended/WorkspaceSuspended.tsx
+++ b/frontend/src/pages/WorkspaceSuspended/WorkspaceSuspended.tsx
@@ -61,7 +61,7 @@ function WorkspaceSuspended(): JSX.Element {
if (!isFetchingActiveLicenseV3 && activeLicenseV3) {
const shouldSuspendWorkspace =
activeLicenseV3.status === LicenseStatus.SUSPENDED &&
- activeLicenseV3.state === LicenseState.PAYMENT_FAILED;
+ activeLicenseV3.state === LicenseState.DEFAULTED;
if (!shouldSuspendWorkspace) {
history.push(ROUTES.APPLICATION);
diff --git a/frontend/src/types/api/licensesV3/getActive.ts b/frontend/src/types/api/licensesV3/getActive.ts
index e12af475e9..5e89b2a75e 100644
--- a/frontend/src/types/api/licensesV3/getActive.ts
+++ b/frontend/src/types/api/licensesV3/getActive.ts
@@ -1,6 +1,6 @@
export enum LicenseEvent {
NO_EVENT = '',
- FAILED_PAYMENT = 'FAILED_PAYMENT',
+ DEFAULT = 'DEFAULT',
}
export enum LicenseStatus {
@@ -9,7 +9,7 @@ export enum LicenseStatus {
}
export enum LicenseState {
- PAYMENT_FAILED = 'PAYMENT_FAILED',
+ DEFAULTED = 'DEFAULTED',
ACTIVE = 'ACTIVE',
}