405 back reload token with synctokens (#436)

* [#405] added syncToken in calendar params and fetch with sync token

* [#405] changed reload to work with sync-token

* [#405] fixup promise handling, added calendar adding and removing hanlding with refresh

* [#405]  fixed event expansion calls

* [#405 & refactor] added helperfunction to get base event uid + refactored synctoken updates management

* [#405] added pMap lib to process event expansion

* [#405] added flag for no synctoken / new synctoken
This commit is contained in:
Camille Moussu
2026-01-13 11:06:34 +01:00
committed by GitHub
parent bcc3019e4b
commit 478a0e0eb0
36 changed files with 1323 additions and 281 deletions
+7 -6
View File
@@ -42,6 +42,7 @@ import {
EventFormContext,
} from "../../utils/eventFormTempStorage";
import { browserDefaultTimeZone } from "../../utils/timezone";
import { extractEventBaseUuid } from "../../utils/extractEventBaseUuid";
function EventUpdateModal({
eventId,
@@ -261,7 +262,7 @@ function EventUpdateModal({
setCalendarid(calId);
// Handle repetition properly - check both current event and base event
const baseEventId = event.uid.split("/")[0];
const baseEventId = extractEventBaseUuid(event.uid);
const baseEvent = calendarsList[calId]?.events[baseEventId];
const repetitionSource = event.repetition || baseEvent?.repetition;
@@ -478,7 +479,7 @@ function EventUpdateModal({
Object.keys(seriesEvents).forEach((eventId) => {
const instance = seriesEvents[eventId];
if (instance && eventId.split("/")[0] === baseUID) {
if (instance && extractEventBaseUuid(eventId) === baseUID) {
instances[eventId] = { ...instance };
}
});
@@ -614,7 +615,7 @@ function EventUpdateModal({
event.repetition?.freq &&
!repetition.freq
) {
const baseUID = event.uid.split("/")[0];
const baseUID = extractEventBaseUuid(event.uid);
// Save current form data to temp storage before closing
const formDataToSave = saveCurrentFormData();
@@ -653,7 +654,7 @@ function EventUpdateModal({
// Collect all instances that need to be deleted
const instancesToDelete = Object.keys(targetCalendar.events)
.filter((eventId) => eventId.split("/")[0] === baseUID)
.filter((eventId) => extractEventBaseUuid(eventId) === baseUID)
.map((eventId) => targetCalendar.events[eventId]);
// Get unique URLs to avoid deleting same file multiple times
@@ -819,7 +820,7 @@ function EventUpdateModal({
}
} else if (typeOfAction === "all") {
// Update all instances - check if repetition rules changed
const baseUID = event.uid.split("/")[0];
const baseUID = extractEventBaseUuid(event.uid);
const changes = detectRecurringEventChanges(
event,
@@ -1074,7 +1075,7 @@ function EventUpdateModal({
moveEventAsync({
cal: targetCalendar,
newEvent,
newURL: `/calendars/${newCalId}/${event.uid.split("/")[0]}.ics`,
newURL: `/calendars/${newCalId}/${extractEventBaseUuid(event.uid)}.ics`,
})
);