diff --git a/attached_assets/Pasted--startDate-2025-08-20-dueDate-2025-08-21-DatabaseStorage-updateTas-1755602534376_1755602534377.txt b/attached_assets/Pasted--startDate-2025-08-20-dueDate-2025-08-21-DatabaseStorage-updateTas-1755602534376_1755602534377.txt new file mode 100644 index 0000000..d0720e5 --- /dev/null +++ b/attached_assets/Pasted--startDate-2025-08-20-dueDate-2025-08-21-DatabaseStorage-updateTas-1755602534376_1755602534377.txt @@ -0,0 +1,200 @@ + + + startDate: '2025-08-20', + + dueDate: '2025-08-21' + +} + +๐Ÿ’พ DatabaseStorage.updateTask - Input: { + + taskId: 99, + + taskData: { + + title: 'test', + + description: 'test', + + priority: 'medium', + + status: 'pending', + + assignedTo: 'test', + + startDate: '2025-08-20', + + dueDate: '2025-08-21' + + }, + + dueDate: '2025-08-21', + + dueDateType: 'string', + + dueDateISO: '2025-08-21' + +} + +๐Ÿงน Cleaned data for database update: { + + title: 'test', + + description: 'test', + + priority: 'medium', + + status: 'pending', + + assignedTo: 'test', + + startDate: '2025-08-20', + + dueDate: '2025-08-21', + + updatedAt: 2025-08-19T11:21:56.027Z + +} + +โŒ DatabaseStorage.updateTask - Database Error: { + + taskId: 99, + + error: 'value.toISOString is not a function', + + cleanData: { + + title: 'test', + + description: 'test', + + priority: 'medium', + + status: 'pending', + + assignedTo: 'test', + + startDate: '2025-08-20', + + dueDate: '2025-08-21', + + updatedAt: 2025-08-19T11:21:56.027Z + + } + +} + +file:///app/dist/index.js:6700 + + taskId: id, + + ^ + +ReferenceError: id is not defined + + at file:///app/dist/index.js:6700:17 + + at process.processTicksAndRejections (node:internal/process/task_queues:95:5) + +Node.js v20.19.4 + +Applying DLC migration... + +NOTICE: column "stock_epuise" of relation "dlc_products" already exists, skipping + +NOTICE: column "stock_epuise_by" of relation "dlc_products" already exists, skipping + +NOTICE: column "stock_epuise_at" of relation "dlc_products" already exists, skipping + +NOTICE: relation "idx_dlc_products_stock_epuise" already exists, skipping + +ALTER TABLE + + CREATE INDEX + +๐Ÿ”— Database initialization: { + + NODE_ENV: 'production', + + isProduction: true, + + hasDbUrl: true, + + dbHost: 'logiflow-db' + +} + +๐Ÿณ PRODUCTION: Using standard PostgreSQL + +โœ… PostgreSQL connection test successful + +๐Ÿ”— Database initialization: { + + NODE_ENV: 'production', + + isProduction: true, + + hasDbUrl: true, + + dbHost: 'logiflow-db:5432' + +} + +โœ… Using DatabaseStorage (production PostgreSQL) + +โฐ Automatic backup scheduled for 2:00 AM daily (native timer) + +๐Ÿ” Using development storage and authentication + +๐Ÿณ PRODUCTION: Starting LogiFlow application + +๐Ÿณ Environment: { NODE_ENV: 'production', DATABASE_URL: 'Present', PORT: '3000' } + +๐Ÿ’พ [PRODUCTION] Backup service initialized for automatic daily backups + +๐Ÿ”ง Registering all production routes... + +๐Ÿ”„ Running automatic production migrations... + +๐Ÿ”„ MIGRATION: Starting SAV production migrations... + +๐Ÿ”„ MIGRATION: Database URL configured: postgresql://logiflow_admin:Lo... + +โœ… MIGRATION: Connected to PostgreSQL database + +๐Ÿ”„ MIGRATION: Checking if priority column exists... + +๐Ÿ”„ MIGRATION: Priority column check result: 1 + +โœ… MIGRATION: Priority column already exists, skipping migration + +๐Ÿ”Œ MIGRATION: Database connection closed + +๐ŸŒค๏ธ [PRODUCTION] Initializing weather system... + +๐ŸŒค๏ธ [AUTO-CONFIG] Initializing weather configuration... + +โœ… [AUTO-CONFIG] Weather settings already configured and active + +โœ… [PRODUCTION] Weather system initialized + +๐ŸŒ Environment detected: production + +๐Ÿ”ง Using memory session store for development + +Warning: connect.session() MemoryStore is not + +designed for a production environment, as it will leak + +memory, and will not scale past a single process. + +โœ… All routes registered successfully for production + +๐Ÿณ Serving static files from: /app/dist/public + +๐Ÿณ PRODUCTION: LogiFlow serving on port 3000 + +HEAD /api/health 200 in 8ms + + + \ No newline at end of file diff --git a/attached_assets/{B40F25BC-E33A-499A-B2F3-D3E7C5640F3A}_1755602554644.png b/attached_assets/{B40F25BC-E33A-499A-B2F3-D3E7C5640F3A}_1755602554644.png new file mode 100644 index 0000000..b5e0b5c Binary files /dev/null and b/attached_assets/{B40F25BC-E33A-499A-B2F3-D3E7C5640F3A}_1755602554644.png differ diff --git a/server/routes.ts b/server/routes.ts index 0a53a7b..569ef0e 100644 --- a/server/routes.ts +++ b/server/routes.ts @@ -1482,11 +1482,21 @@ export async function registerRoutes(app: Express): Promise { }); res.json(updatedTask); } catch (error) { - console.error("โŒ Error updating task:", { - taskId: id, + const taskId = parseInt(req.params.id); + console.error("โŒ Error updating task in route:", { + taskId: taskId, error: error instanceof Error ? error.message : String(error), stack: error instanceof Error ? error.stack : undefined, - reqBody: req.body + reqBody: req.body, + cleanData: req.body ? { + title: req.body.title, + description: req.body.description, + priority: req.body.priority, + status: req.body.status, + assignedTo: req.body.assignedTo, + startDate: req.body.startDate, + dueDate: req.body.dueDate, + } : null }); res.status(500).json({ message: "Failed to update task", diff --git a/server/storage.ts b/server/storage.ts index 7d59452..ec00906 100644 --- a/server/storage.ts +++ b/server/storage.ts @@ -1725,10 +1725,10 @@ export class DatabaseStorage implements IStorage { if (taskData.status !== undefined) cleanData.status = taskData.status; if (taskData.assignedTo !== undefined) cleanData.assignedTo = taskData.assignedTo; if (taskData.startDate !== undefined) { - cleanData.startDate = taskData.startDate === '' ? null : taskData.startDate; + cleanData.startDate = taskData.startDate === '' || taskData.startDate === null ? null : taskData.startDate; } if (taskData.dueDate !== undefined) { - cleanData.dueDate = taskData.dueDate === '' ? null : taskData.dueDate; + cleanData.dueDate = taskData.dueDate === '' || taskData.dueDate === null ? null : taskData.dueDate; } cleanData.updatedAt = new Date(); @@ -1754,7 +1754,9 @@ export class DatabaseStorage implements IStorage { console.error('โŒ DatabaseStorage.updateTask - Database Error:', { taskId: id, error: error instanceof Error ? error.message : String(error), - cleanData + stack: error instanceof Error ? error.stack : undefined, + cleanData, + originalTaskData: taskData }); throw new Error(`Failed to update task in database: ${error instanceof Error ? error.message : String(error)}`); }