Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions packages/mcp-core/src/api-client/schema.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,31 @@ describe("IssueSchema", () => {
expect(result).toEqual(errorIssue);
});

it("should allow issues with null lastSeen", () => {
const staleIssue = {
id: "321",
shortId: "TEST-321",
title: "Intermittent crash",
firstSeen: "2025-01-01T00:00:00Z",
lastSeen: null,
count: 0,
userCount: 0,
permalink: "https://sentry.io/issues/321/",
project: {
id: "1",
name: "stale-project",
slug: "stale-project",
},
status: "resolved",
culprit: "stale.ts",
type: "error",
};

const result = IssueSchema.parse(staleIssue);

expect(result.lastSeen).toBeNull();
});

it("should parse a regressed performance issue", () => {
// Anonymized payload from real regressed issue (issue #633)
const regressedIssue = {
Expand Down
2 changes: 1 addition & 1 deletion packages/mcp-core/src/api-client/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ export const IssueSchema = z
shortId: z.string(),
title: z.string(),
firstSeen: z.string().datetime(),
lastSeen: z.string().datetime(),
lastSeen: z.string().datetime().nullable(),
count: z.union([z.string(), z.number()]),
userCount: z.union([z.string(), z.number()]),
permalink: z.string().url(),
Expand Down
Loading