From 4e81680058c625da7559b2a25004ab3db7730f82 Mon Sep 17 00:00:00 2001 From: Alexander Kreitner <180843591+Gl4dr3x@users.noreply.github.com> Date: Tue, 1 Dec 2026 10:51:17 +0100 Subject: [PATCH 1/2] fix(route): give updated Message Center posts a new guid The guid was the bare message ID, so an update to an existing post kept the same guid and feed readers that dedupe on it skipped many updates. The guid now carries the last modification time, and the bare ID moves to the author field for consumers that look posts up by ID. Also clears the oxlint errors the pre-commit hook now reports for this file (TypeError, Boolean coercion, useless undefined). Co-Authored-By: Claude Opus 5.5 --- lib/routes/microsoft/message-center.ts | 46 +++++++++++--------------- 1 file changed, 20 insertions(+), 26 deletions(-) diff --git a/lib/routes/microsoft/message-center.ts b/lib/routes/microsoft/message-center.ts index 8a720fb41faf..efa0b479b138 100644 --- a/lib/routes/microsoft/message-center.ts +++ b/lib/routes/microsoft/message-center.ts @@ -46,7 +46,8 @@ export const route: Route = { url: 'mc.merill.net', categories: ['program-update'], example: '/microsoft/message-center', - description: 'Microsoft 365 Message Center archive entries from mc.merill.net.', + description: + 'Microsoft 365 Message Center archive entries from mc.merill.net. The item guid carries the last modification time, so an updated post appears as a new item. The bare message ID (e.g. MC1234567) is in the author field.', features: { requireConfig: false, requirePuppeteer: false, @@ -73,13 +74,11 @@ async function handler(ctx) { const { data: messages }: { data: MessageCenterMessage[] } = await got(dataUrl); if (!Array.isArray(messages)) { - throw new Error('Failed to fetch Microsoft 365 Message Center archive data.'); + throw new TypeError('Failed to fetch Microsoft 365 Message Center archive data.'); } - const item = messages - .filter(isMessageCenterMessage) - .slice() - .sort((a, b) => getTimestamp(b) - getTimestamp(a)) + const item = [...messages.filter(isMessageCenterMessage)] + .toSorted((a, b) => getTimestamp(b) - getTimestamp(a)) .slice(0, pageSize) .map((message): DataItem => { const link = `${rootUrl}/message/${message.Id}`; @@ -93,7 +92,8 @@ async function handler(ctx) { return { title: message.Title, link, - guid: message.Id, + guid: getVersionedGuid(message), + author: message.Id, description, pubDate, updated, @@ -113,6 +113,12 @@ async function handler(ctx) { }; } +function getVersionedGuid(message: MessageCenterMessage) { + const version = message.LastModifiedDateTime || message.StartDateTime; + + return version ? `${message.Id}@${version}` : message.Id; +} + function getTimestamp(message: MessageCenterMessage) { const date = message.LastModifiedDateTime || message.StartDateTime; @@ -120,23 +126,16 @@ function getTimestamp(message: MessageCenterMessage) { } function getCategories(message: MessageCenterMessage, messageCenterCategory?: string) { - const categories = [ - messageCenterCategory, - message.Severity, - ...(message.Services ?? []), - ...(message.Tags ?? []), - ].filter((category): category is string => Boolean(category)); + const categories = [messageCenterCategory, message.Severity, ...(message.Services ?? []), ...(message.Tags ?? [])].filter((category): category is string => !!category); return categories.length ? [...new Set(categories)] : undefined; } function getContent(description: string, messageCenterCategory?: string, severity?: string, endDate?: Date) { const endDateValue = endDate && !Number.isNaN(endDate.getTime()) ? endDate.toISOString() : undefined; - const metadata = [ - messageCenterCategory ? `MessageCenterCategory: ${messageCenterCategory}` : undefined, - severity ? `Severity: ${severity}` : undefined, - endDateValue ? `EndDateTime: ${endDateValue}` : undefined, - ].filter((value): value is string => Boolean(value)); + const metadata = [messageCenterCategory ? `MessageCenterCategory: ${messageCenterCategory}` : undefined, severity ? `Severity: ${severity}` : undefined, endDateValue ? `EndDateTime: ${endDateValue}` : undefined].filter( + (value): value is string => !!value + ); if (!metadata.length) { return { @@ -159,7 +158,7 @@ function getDetailValue(message: MessageCenterMessage, name: string) { } function getMessageCenterCategory(category?: string) { - return category ? categoryLabels[category] ?? category : undefined; + return category ? (categoryLabels[category] ?? category) : undefined; } function getImages(description: string) { @@ -229,7 +228,7 @@ function getAbsoluteUrl(url: string) { try { return new URL(url, rootUrl).href; } catch { - return undefined; + return; } } @@ -260,10 +259,5 @@ function isRoadmapTitle(title: string) { } function escapeHtml(value: string) { - return value - .replaceAll('&', '&') - .replaceAll('<', '<') - .replaceAll('>', '>') - .replaceAll('"', '"') - .replaceAll("'", '''); + return value.replaceAll('&', '&').replaceAll('<', '<').replaceAll('>', '>').replaceAll('"', '"').replaceAll("'", '''); } From c84f8d22e6cd6ade117e7e46e735c079cd21a3fc Mon Sep 17 00:00:00 2001 From: Alexander Kreitner <180843591+Gl4dr3x@users.noreply.github.com> Date: Tue, 1 Dec 2026 11:13:35 +0100 Subject: [PATCH 2/2] fix(route): drop the redundant array spread before sorting Co-Authored-By: Claude Opus 5.5 --- lib/routes/microsoft/message-center.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/routes/microsoft/message-center.ts b/lib/routes/microsoft/message-center.ts index efa0b479b138..5661ae68b35f 100644 --- a/lib/routes/microsoft/message-center.ts +++ b/lib/routes/microsoft/message-center.ts @@ -77,7 +77,8 @@ async function handler(ctx) { throw new TypeError('Failed to fetch Microsoft 365 Message Center archive data.'); } - const item = [...messages.filter(isMessageCenterMessage)] + const item = messages + .filter((message) => isMessageCenterMessage(message)) .toSorted((a, b) => getTimestamp(b) - getTimestamp(a)) .slice(0, pageSize) .map((message): DataItem => {