Skip to content

Commit cf12a3d

Browse files
committed
Devin fix
1 parent 3232d56 commit cf12a3d

File tree

1 file changed

+22
-6
lines changed

1 file changed

+22
-6
lines changed

apps/webapp/app/v3/services/alerts/errorAlertEvaluator.server.ts

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,12 @@ export class ErrorAlertEvaluator {
171171
}
172172
}
173173

174-
const stateUpdates = alertableErrors.filter(
175-
(a) => a.classification === "regression" || a.classification === "unignored"
174+
await this.updateErrorGroupStates(
175+
alertableErrors,
176+
stateMap,
177+
project.organizationId,
178+
projectId
176179
);
177-
await this.updateErrorGroupStates(stateUpdates, stateMap);
178180

179181
logger.info("[ErrorAlertEvaluator] Evaluation complete", {
180182
projectId,
@@ -424,14 +426,16 @@ export class ErrorAlertEvaluator {
424426

425427
private async updateErrorGroupStates(
426428
alertableErrors: AlertableError[],
427-
stateMap: Map<string, ErrorGroupState>
429+
stateMap: Map<string, ErrorGroupState>,
430+
organizationId: string,
431+
projectId: string
428432
): Promise<void> {
429433
for (const alertable of alertableErrors) {
430434
const key = `${alertable.error.environment_id}:${alertable.error.task_identifier}:${alertable.error.error_fingerprint}`;
431435
const state = stateMap.get(key);
432-
if (!state) continue;
433436

434-
await this._prisma.errorGroupState.update({
437+
if (state) {
438+
await this._prisma.errorGroupState.update({
435439
where: { id: state.id },
436440
data: {
437441
status: "UNRESOLVED",
@@ -447,6 +451,18 @@ export class ErrorAlertEvaluator {
447451
resolvedBy: null,
448452
},
449453
});
454+
} else if (alertable.classification === "new_issue") {
455+
await this._prisma.errorGroupState.create({
456+
data: {
457+
organizationId,
458+
projectId,
459+
environmentId: alertable.error.environment_id,
460+
taskIdentifier: alertable.error.task_identifier,
461+
errorFingerprint: alertable.error.error_fingerprint,
462+
status: "UNRESOLVED",
463+
},
464+
});
465+
}
450466
}
451467
}
452468

0 commit comments

Comments
 (0)