Skip to content

Private AI meeting notes that stay on your computer. No meeting bot. Free and open source for Mac, Windows and Linux. An alternative to Granola, Otter and Fireflies.

Calendar link: an occurrence moved into the window from a later date is no longer dropped (#120)

Arda Zeybekba44c614e4b7
diff --git a/app/src/main/calendarLink/ics.ts b/app/src/main/calendarLink/ics.ts
index 41b9136d..9984bac4 100644
--- a/app/src/main/calendarLink/ics.ts
+++ b/app/src/main/calendarLink/ics.ts
@@ -109,11 +109,16 @@ export function icsFeed(text: string, link: LinkRef) {
const it = ev.iterator()
for (let i = 0, next = it.next(); next && i < MAX_STEPS; i++, next = it.next()) {
const at = next.toJSDate().getTime()
- if (at >= toMs && !moved.has(next.toString())) break
- if (at + lasts <= fromMs && !moved.has(next.toString())) continue
+ if (at >= toMs) break
+ if (at + lasts <= fromMs || moved.has(next.toString())) continue
const d = ev.getOccurrenceDetails(next)
add(d.item, d.startDate, d.endDate)
}
+ // moved copies are read by their own time: the original date can be long after the window
+ for (const x of Object.values(ev.exceptions)) {
+ const d = ev.getOccurrenceDetails(x.recurrenceId)
+ add(d.item, d.startDate, d.endDate)
+ }
}
return out
}
diff --git a/app/test/calendarLinkIcs.test.ts b/app/test/calendarLinkIcs.test.ts
index 30759148..6bdc997e 100644
--- a/app/test/calendarLinkIcs.test.ts
+++ b/app/test/calendarLinkIcs.test.ts
@@ -132,6 +132,24 @@ END:VEVENT`
expect(details.mock.calls.length).toBeLessThan(20)
details.mockRestore()
})
+ it('an occurrence moved into the window from a date long after it still shows', () => {
+ const weekly = `BEGIN:VEVENT
+SUMMARY:Sync
+DTSTART:20261102T150000Z
+DTEND:20261102T153000Z
+RRULE:FREQ=WEEKLY
+END:VEVENT
+BEGIN:VEVENT
+RECURRENCE-ID:20261214T150000Z
+SUMMARY:Moved up
+DTSTART:20261120T180000Z
+DTEND:20261120T183000Z
+END:VEVENT`
+ const got = icsEvents(feed(weekly), at('2026-11-20T00:00:00Z'), at('2026-11-21T00:00:00Z'), link)
+ expect(got.map((e) => e.title)).toEqual(['Moved up'])
+ })
it('building a feed of many events does not look through the whole feed once per event (thousands of events took seconds)', () => {
const many = Array.from({ length: 50 }, (_, i) => `BEGIN:VEVENT\nUID:one-${i}@example.com\nSUMMARY:One ${i}\nDTSTART:20190101T1000${String(i).padStart(2, '0')}Z\nDTEND:20190101T1100${String(i).padStart(2, '0')}Z\nEND:VEVENT`).join('\n')
const scans = vi.spyOn(ICAL.Component.prototype, 'getAllSubcomponents')