MCPcopy
hub / github.com/gitify-app/gitify / enrichNotification

Function enrichNotification

src/renderer/utils/notifications/notifications.ts:227–262  ·  view source on GitHub ↗
(
  notification: GitifyNotification,
  settings: SettingsState,
  fetchedData?: unknown,
)

Source from the content-addressed store, hash-verified

225 * @returns The enriched notification.
226 */
227export async function enrichNotification(
228 notification: GitifyNotification,
229 settings: SettingsState,
230 fetchedData?: unknown,
231): Promise<GitifyNotification> {
232 let additionalSubjectDetails: Partial<GitifySubject> = {};
233
234 try {
235 const handler = createNotificationHandler(notification);
236 additionalSubjectDetails = await handler.enrich(
237 notification,
238 settings,
239 fetchedData,
240 );
241 } catch (err) {
242 rendererLogError(
243 'enrichNotification',
244 'failed to enrich notification details for',
245 toError(err),
246 notification,
247 );
248
249 rendererLogWarn(
250 'enrichNotification',
251 'Continuing with base notification details',
252 );
253 }
254
255 return {
256 ...notification,
257 subject: {
258 ...notification.subject,
259 ...additionalSubjectDetails,
260 },
261 };
262}
263
264/**
265 * Assign an order property to each notification to stabilize how they are displayed

Callers 2

enrichNotificationsFunction · 0.85

Calls 5

rendererLogErrorFunction · 0.90
toErrorFunction · 0.90
rendererLogWarnFunction · 0.90
enrichMethod · 0.65

Tested by

no test coverage detected