Fix scheduled task errors and improve error handling

- Fix webhook retry scheduled task app context issue
  * Update retry_failed_webhooks() to properly capture and use app instance
  * Pass app instance when registering scheduled tasks
  * Prevents 'Working outside of application context' errors

- Improve timezone function error handling
  * Add app context check before database access in get_app_timezone()
  * Gracefully fallback to environment variable when app context unavailable
  * Prevents RuntimeError when accessing database outside app context

- Add error deduplication to prevent stacked error messages
  * Track recent errors to prevent duplicate notifications within 1 minute
  * Reduces error message stacking when same error occurs repeatedly
  * Still logs all errors to console for debugging

- Fix theme toggle endpoint error
  * Change from /api/preferences (PATCH) to /api/theme (POST)
  * Add proper error handling to prevent unhandled promise rejections
  * Fixes 405 Method Not Allowed error when changing theme

- Bump version to 3.10.3
This commit is contained in:
Dries Peeters
2025-11-20 20:51:53 +01:00
parent 4e8b42ad56
commit 60fb259f9e
6 changed files with 316 additions and 206 deletions

View File

@@ -7,7 +7,7 @@ from setuptools import setup, find_packages
setup(
name='timetracker',
version='3.10.2',
version='3.10.3',
packages=find_packages(),
include_package_data=True,
install_requires=[