chore: add debug logging for Synology calendar pruning
Log individual calendar names/URLs from server and stale calendar IDs to diagnose why deleted calendars persist in stored list. v1.57.5 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
93e808ddfa
commit
af46c0c21f
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "my-weekly-todo-list",
|
||||
"version": "1.57.4",
|
||||
"version": "1.57.5",
|
||||
"description": "A web-based weekly task management application that organizes to-dos and calendar events in a single, intuitive weekly view",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
||||
@ -50,6 +50,11 @@ export async function GET(request: NextRequest) {
|
||||
if (username && password && serverUrl) {
|
||||
const freshCalendars = await getSynologyCalendars(serverUrl, username, password);
|
||||
const freshIds = new Set(freshCalendars.map(c => c.id));
|
||||
const storedIds = calendars.map((c: any) => c.id);
|
||||
const staleIds = storedIds.filter((id: string) => !freshIds.has(id));
|
||||
if (staleIds.length > 0) {
|
||||
console.log('[CONNECTIONS] Synology stale calendars to prune:', staleIds);
|
||||
}
|
||||
const pruned = calendars.filter((c: any) => freshIds.has(c.id));
|
||||
if (pruned.length < calendars.length) {
|
||||
calendars = pruned;
|
||||
|
||||
@ -201,6 +201,9 @@ export const validateCredentials = async (serverUrl: string, username: string, p
|
||||
}));
|
||||
|
||||
console.log('[SYNOLOGY CALENDAR] Found calendars:', mappedCalendars.length, '(filtered from', calendars.length, 'total)');
|
||||
for (const cal of mappedCalendars) {
|
||||
console.log(`[SYNOLOGY CALENDAR] - "${cal.title}" → ${cal.id}`);
|
||||
}
|
||||
return mappedCalendars;
|
||||
} catch (error) {
|
||||
console.error('Synology Calendar validation failed:', error);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user