mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-08-28 17:21:05 +00:00
tweak: update rolling perofrmance
This commit is contained in:
@@ -341,13 +341,13 @@
|
||||
aria-haspopup="menu"
|
||||
aria-expanded={menuOpen}
|
||||
aria-busy={isBusy}
|
||||
aria-label={status.connected ? "Google Calendar sync options" : "Connect Google Calendar"}
|
||||
aria-label={status.connected ? "Google Calendar sync options" : "Sync with Calendar"}
|
||||
onclick={() => {
|
||||
if (!isBusy) toggleMenu();
|
||||
}}
|
||||
>
|
||||
<span class="bsplus-cal-trigger-icon" aria-hidden="true"></span>
|
||||
<span class="bsplus-cal-trigger-text">Calendar</span>
|
||||
<span class="bsplus-cal-trigger-text">Sync with Calendar</span>
|
||||
{#if status.connected}
|
||||
<span class="bsplus-cal-status-dot" aria-hidden="true"></span>
|
||||
{/if}
|
||||
@@ -433,7 +433,7 @@
|
||||
/>
|
||||
</label>
|
||||
<p class="bsplus-cal-setting-hint">
|
||||
Keeps a rolling {syncWeeksAhead}-week window. Each week adds the next week and removes the oldest.
|
||||
Syncs {syncWeeksAhead} weeks ahead on connect and manual sync. Weekly auto-sync adds each new week forward.
|
||||
</p>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
@@ -97,6 +97,19 @@ describe("syncLessonsToGoogleCalendar", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("does not delete events during incremental sync", async () => {
|
||||
const result = await syncLessonsToGoogleCalendar(
|
||||
{ origin: ORIGIN, lessons: [baseLesson], mode: "incremental" },
|
||||
getAccessToken,
|
||||
);
|
||||
|
||||
expect(deleteGoogleCalendarEvent).not.toHaveBeenCalled();
|
||||
expect(result).toMatchObject({
|
||||
success: true,
|
||||
deleted: 0,
|
||||
});
|
||||
});
|
||||
|
||||
it("reports progress while syncing", async () => {
|
||||
const progress: Array<{ phase: string; current: number; total: number }> = [];
|
||||
await syncLessonsToGoogleCalendar(
|
||||
|
||||
@@ -7,7 +7,6 @@ import {
|
||||
normalizeEventMapEntry,
|
||||
} from "@/seqta/utils/googleCalendar/eventMapEntry";
|
||||
import {
|
||||
droppedWeekRange,
|
||||
isDateInRange,
|
||||
syncWindowRange,
|
||||
} from "@/seqta/utils/googleCalendar/syncDateRange";
|
||||
@@ -120,7 +119,6 @@ function entriesToPrune(
|
||||
currentMapKeys: Set<string>,
|
||||
): Array<[string, string]> {
|
||||
const window = syncWindowRange(weeksAhead);
|
||||
const dropped = droppedWeekRange(weeksAhead);
|
||||
const prefix = `${origin}::`;
|
||||
const entries: Array<[string, string]> = [];
|
||||
|
||||
@@ -131,7 +129,7 @@ function entriesToPrune(
|
||||
|
||||
let shouldDelete = false;
|
||||
if (mode === "incremental") {
|
||||
shouldDelete = !!entry.date && isDateInRange(entry.date, dropped);
|
||||
shouldDelete = false;
|
||||
} else if (entry.date) {
|
||||
shouldDelete = !isDateInRange(entry.date, window);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user