{"record":{"id":"b922a4c135d373f7","repo":"mantinedev/mantine","slug":"mantine-schedule-mobilemonthview-duplicated-ev","errorCode":null,"errorMessage":"[@mantine/schedule] MobileMonthView: Duplicated event ids found: ${event.id}","messagePattern":"\\[@mantine/schedule\\] MobileMonthView: Duplicated event ids found: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/@mantine/schedule/src/components/MobileMonthView/get-mobile-month-view-events.ts","lineNumber":59,"sourceCode":"\n  if (events === undefined) {\n    return groupedEvents;\n  }\n\n  const ids = new Set<string | number>();\n\n  for (const event of events) {\n    if (event.display === 'background') {\n      continue;\n    }\n\n    if (dayjs(event.start).isSame(dayjs(date), 'month')) {\n      groupEventByDate(validateEvent(event), groupedEvents);\n\n      if (!ids.has(event.id)) {\n        ids.add(event.id);\n      } else {\n        throw new Error(\n          `[@mantine/schedule] MobileMonthView: Duplicated event ids found: ${event.id}`\n        );\n      }\n    }\n  }\n\n  return groupedEvents;\n}\n","sourceCodeStart":41,"sourceCodeEnd":68,"githubUrl":"https://github.com/mantinedev/mantine/blob/8a284e2c2c53a9cb6f39f5dc389bf41b7a2073f8/packages/@mantine/schedule/src/components/MobileMonthView/get-mobile-month-view-events.ts#L41-L68","documentation":"MobileMonthView validates event id uniqueness while grouping events by date for the month display on small screens. If the same id appears more than once among the month's events, this error is thrown during render.","triggerScenarios":"Passing duplicated event ids to Schedule when the mobile month view is rendered; the same event appearing twice because a data transform appended it for each day it spans.","commonSituations":"Responsive testing on mobile widths exposing duplicates that desktop views also reject; merging event feeds; recurring events expanded without unique per-occurrence ids.","solutions":["Deduplicate the events array by id before passing it to Schedule","Assign unique ids when expanding recurring events","Fix the backend or fetch layer that returns duplicated records"],"exampleFix":"// before\n<Schedule events={rawEvents} />;\n\n// after\nconst events = [...new Map(rawEvents.map((e) => [e.id, e])).values()];\n<Schedule events={events} />;","handlingStrategy":"validation","validationCode":"const unique = [...new Map(events.map((e) => [e.id, e])).values()];\n\n<Schedule events={unique} />;","typeGuard":"function hasUniqueEventIds(events: { id: string | number }[]): boolean {\n  return new Set(events.map((e) => e.id)).size === events.length;\n}","tryCatchPattern":null,"preventionTips":["Apply one dedupe utility to all event sources at the app boundary","Test schedule rendering at mobile breakpoints with production-like data","Keep event id generation centralized"],"tags":["schedule","calendar","duplicate-ids","mobile-month-view"],"backgroundTag":"duplicate-entity-ids","analyzedSha":"8a284e2c2c53a9cb6f39f5dc389bf41b7a2073f8","analyzedAt":"2026-08-28T10:25:51.087Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}