Skip to content

Commit b667160

Browse files
committed
Devin suggested fixes
1 parent 8974b3f commit b667160

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

apps/webapp/app/components/errors/ConfigureErrorAlerts.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,10 @@ export function ConfigureErrorAlerts({
8787
return qs ? `?${qs}` : location.pathname;
8888
})();
8989

90+
const hasHandledSuccess = useRef(false);
9091
useEffect(() => {
91-
if (fetcher.state === "idle" && fetcher.data?.ok) {
92+
if (fetcher.state === "idle" && fetcher.data?.ok && !hasHandledSuccess.current) {
93+
hasHandledSuccess.current = true;
9294
toast.success("Alert settings saved");
9395
navigate(closeHref, { replace: true });
9496
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ export class ErrorGroupPresenter extends BasePresenter {
368368

369369
let ignoredByUserDisplayName: string | null = null;
370370
if (row.ignoredByUserId) {
371-
const user = await this.replica.user.findUnique({
371+
const user = await this.replica.user.findFirst({
372372
where: { id: row.ignoredByUserId },
373373
select: { displayName: true, name: true, email: true },
374374
});

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.errors.$fingerprint/route.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,13 @@ export const action = async ({ request, params }: ActionFunctionArgs) => {
170170
qb.groupBy("error_fingerprint, task_identifier");
171171

172172
const [err, results] = await qb.execute();
173-
if (!err && results && results.length > 0) {
174-
occurrenceCountAtIgnoreTime = results[0].occurrence_count;
173+
if (err || !results || results.length === 0) {
174+
return json(
175+
{ error: "Failed to fetch current occurrence count. Please try again." },
176+
{ status: 500 }
177+
);
175178
}
179+
occurrenceCountAtIgnoreTime = results[0].occurrence_count;
176180
}
177181

178182
await actions.ignoreError(identifier, {

0 commit comments

Comments
 (0)