fix: retry individual Apple calendar fetches on network timeout
Batch errors like 'fetch failed' were only retried at the login/client-init level. Per-calendar fetchCalendarObjects calls had no retry, so a single transient iCloud network timeout silently dropped all events from that calendar. Now wraps each fetchCalendarObjects with withRetry(2 retries, 3s/6s). v1.77.5
This commit is contained in:
parent
4c1ef5019e
commit
b8c8e9257a
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "my-weekly-todo-list",
|
"name": "my-weekly-todo-list",
|
||||||
"version": "1.77.4",
|
"version": "1.77.5",
|
||||||
"description": "A web-based weekly task management application that organizes to-dos and calendar events in a single, intuitive weekly view",
|
"description": "A web-based weekly task management application that organizes to-dos and calendar events in a single, intuitive weekly view",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@ -496,13 +496,16 @@ export const getUpcomingEventsBatch = async (
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
const events = await client.fetchCalendarObjects({
|
const events = await withRetry(
|
||||||
calendar: targetCalendar,
|
() => client.fetchCalendarObjects({
|
||||||
timeRange: {
|
calendar: targetCalendar,
|
||||||
start: new Date(timeMin).toISOString(),
|
timeRange: {
|
||||||
end: new Date(timeMax).toISOString(),
|
start: new Date(timeMin).toISOString(),
|
||||||
},
|
end: new Date(timeMax).toISOString(),
|
||||||
});
|
},
|
||||||
|
}),
|
||||||
|
2, `fetchCalendarObjects:${calendarUrl.split('/').pop()}`
|
||||||
|
);
|
||||||
|
|
||||||
const parsedEvents: AppleCalendarEvent[] = [];
|
const parsedEvents: AppleCalendarEvent[] = [];
|
||||||
const minTime = new Date(timeMin).getTime();
|
const minTime = new Date(timeMin).getTime();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user