Skip to content

Open-source status page, incident response and uptime monitoring

fix: incident null

mxkaske5fde5a0ae0ea
diff --git a/apps/server/src/checker/index.ts b/apps/server/src/checker/index.ts
index 8a5f4c638..798d688d4 100644
--- a/apps/server/src/checker/index.ts
+++ b/apps/server/src/checker/index.ts
@@ -1,7 +1,7 @@
import { Hono } from "hono";
import { z } from "zod";
-import { and, db, eq, isNotNull, schema } from "@openstatus/db";
+import { and, db, eq, isNull, schema } from "@openstatus/db";
import { incidentTable } from "@openstatus/db/src/schema";
import { flyRegions } from "@openstatus/db/src/schema/monitors/constants";
import { selectMonitorSchema } from "@openstatus/db/src/schema/monitors/validation";
@@ -52,11 +52,12 @@ checkerRoute.post("/updateStatus", async (c) => {
.where(
and(
eq(incidentTable.monitorId, Number(monitorId)),
- isNotNull(incidentTable.resolvedAt),
- isNotNull(incidentTable.acknowledgedAt),
+ isNull(incidentTable.resolvedAt),
+ isNull(incidentTable.acknowledgedAt),
),
)
.get();
+
// if we are in error
if (!statusCode || (statusCode < 200 && statusCode > 300)) {
// create incident