()
| 353 | } |
| 354 | |
| 355 | private async refreshStats() { |
| 356 | try { |
| 357 | // Clear cache to ensure fresh data |
| 358 | this.clearCache(); |
| 359 | |
| 360 | const results = await Promise.allSettled([ |
| 361 | this.updateOverviewStats(), |
| 362 | this.updateTodayStats(), |
| 363 | this.updateWeekStats(), |
| 364 | this.updateMonthStats(), |
| 365 | this.updateProjectStats(), |
| 366 | ]); |
| 367 | |
| 368 | // Log any failures in development |
| 369 | if (process.env.NODE_ENV === "development") { |
| 370 | results.forEach((result, index) => { |
| 371 | if (result.status === "rejected") { |
| 372 | const sections = ["overview", "today", "week", "month", "projects"]; |
| 373 | tasknotesLogger.warn(`Failed to update ${sections[index]} stats:`, { |
| 374 | category: "validation", |
| 375 | operation: "update", |
| 376 | details: { value: result.reason }, |
| 377 | }); |
| 378 | } |
| 379 | }); |
| 380 | } |
| 381 | } catch { |
| 382 | // Failed to refresh stats - continue silently |
| 383 | } |
| 384 | } |
| 385 | |
| 386 | private async getAllTasks(): Promise<TaskInfo[]> { |
| 387 | const cacheKey = `all-tasks-${JSON.stringify(this.currentFilters)}`; |
no test coverage detected