fix(polling): advance calendar cursor past fully-filtered event batches

This commit is contained in:
waleed
2026-04-09 23:04:10 -07:00
parent 66e0188177
commit 9a33570bee

View File

@@ -282,12 +282,6 @@ async function processEvents(
let latestUpdated: string | null = null
for (const event of events) {
// Client-side event type filter — skip before idempotency so filtered events aren't cached
const computedEventType = determineEventType(event)
if (eventTypeFilter && computedEventType !== eventTypeFilter) {
continue
}
// Track the latest `updated` timestamp for clock-skew-free state tracking
if (event.updated) {
if (!latestUpdated || event.updated > latestUpdated) {
@@ -295,6 +289,12 @@ async function processEvents(
}
}
// Client-side event type filter — skip before idempotency so filtered events aren't cached
const computedEventType = determineEventType(event)
if (eventTypeFilter && computedEventType !== eventTypeFilter) {
continue
}
try {
// Idempotency key includes `updated` so re-edits of the same event re-trigger
const idempotencyKey = `${webhookData.id}:${event.id}:${event.updated || event.created || ''}`