mirror of
https://github.com/simstudioai/sim.git
synced 2026-04-28 03:00:29 -04:00
fix(polling): advance calendar cursor past fully-filtered event batches
This commit is contained in:
@@ -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 || ''}`
|
||||
|
||||
Reference in New Issue
Block a user