DeprecationWarning: datetime.datetime.utcnow() is deprecated and
scheduled for removal in a future version. Use timezone-aware objects to
represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
Introduced Turkish language support and non-destructive warranty archiving. Modernized login page, filters, sorting, and tag management with responsive, theme-aware UI updates. Persisted filter/sort state across sessions, improved mobile layout, and fixed dark mode, i18n, and SSO alignment issues.
Fixes & Enhancements
* Resolved five critical Apprise notification issues:
• Ensured configuration reload during scheduled jobs
• Fixed warranty data fetching for Apprise-only users
• Refactored notification dispatch logic with dedicated helpers
• Corrected handler scoping via Flask app context
• Wrapped scheduler jobs with Flask app context to prevent context errors
→ Verified: Scheduled Apprise notifications now work reliably for "Apprise only" and "Both" channels.
* Added support for SMTP\_FROM\_ADDRESS environment variable, allowing sender address customization independent of SMTP username. (PR #115)
* Fixed duplicate scheduled notifications in multi-worker environments:
• Strengthened should\_run\_scheduler() logic
• Now guarantees exactly one scheduler instance across all Gunicorn modes.
* Fixed stale database connection handling in scheduled jobs:
• Fresh connection acquired each run, properly released via try/finally
• Eliminates "server closed the connection" errors.
* Definitive scheduler logic fix for all memory modes (ultra-light, optimized, performance):
• Single-worker runs scheduler if GUNICORN\_WORKER\_ID is unset
• Multi-worker: only worker 0 runs scheduler.
Impact
* Apprise and Email notifications are now stable, reliable, and production-ready
* No more duplicate or missed notifications across all memory modes
* Improved system efficiency and robustness
Fixes & Enhancements
* Resolved five critical Apprise notification issues:
• Ensured configuration reload during scheduled jobs
• Fixed warranty data fetching for Apprise-only users
• Refactored notification dispatch logic with dedicated helpers
• Corrected handler scoping via Flask app context
• Wrapped scheduler jobs with Flask app context to prevent context errors
→ Verified: Scheduled Apprise notifications now work reliably for "Apprise only" and "Both" channels.
* Added support for SMTP\_FROM\_ADDRESS environment variable, allowing sender address customization independent of SMTP username. (PR #115)
* Fixed duplicate scheduled notifications in multi-worker environments:
• Strengthened should\_run\_scheduler() logic
• Now guarantees exactly one scheduler instance across all Gunicorn modes.
* Fixed stale database connection handling in scheduled jobs:
• Fresh connection acquired each run, properly released via try/finally
• Eliminates "server closed the connection" errors.
* Definitive scheduler logic fix for all memory modes (ultra-light, optimized, performance):
• Single-worker runs scheduler if GUNICORN\_WORKER\_ID is unset
• Multi-worker: only worker 0 runs scheduler.
Impact
* Apprise and Email notifications are now stable, reliable, and production-ready
* No more duplicate or missed notifications across all memory modes
* Improved system efficiency and robustness
Fixes & Enhancements
* Resolved five critical Apprise notification issues:
• Ensured configuration reload during scheduled jobs
• Fixed warranty data fetching for Apprise-only users
• Refactored notification dispatch logic with dedicated helpers
• Corrected handler scoping via Flask app context
• Wrapped scheduler jobs with Flask app context to prevent context errors
→ Verified: Scheduled Apprise notifications now work reliably for "Apprise only" and "Both" channels.
* Added support for SMTP\_FROM\_ADDRESS environment variable, allowing sender address customization independent of SMTP username. (PR #115)
* Fixed duplicate scheduled notifications in multi-worker environments:
• Strengthened should\_run\_scheduler() logic
• Now guarantees exactly one scheduler instance across all Gunicorn modes.
* Fixed stale database connection handling in scheduled jobs:
• Fresh connection acquired each run, properly released via try/finally
• Eliminates "server closed the connection" errors.
* Definitive scheduler logic fix for all memory modes (ultra-light, optimized, performance):
• Single-worker runs scheduler if GUNICORN\_WORKER\_ID is unset
• Multi-worker: only worker 0 runs scheduler.
Impact
* Apprise and Email notifications are now stable, reliable, and production-ready
* No more duplicate or missed notifications across all memory modes
* Improved system efficiency and robustness
Resolved critical scheduler initialization bug in Docker ultra-light mode by moving scheduler setup into the create_app() function and improving worker detection logic. Added missing /api/timezones and /api/locales endpoints to support frontend settings page. Ensured compatibility across all memory modes with single-worker and multi-worker setups. Also fixed mobile UI issues including text overflow on the "Manage Tags" button and oversized warranty cards in list view. Implemented responsive CSS adjustments for mobile screens to improve layout and usability.
### Highlights:
- **Environment Variable Precedence Fix:** Corrected config loading logic to prioritize environment variables over database defaults on fresh installations. Ensured OIDC, Apprise, and email settings are now correctly derived from `.env` files. Also fixed the `/api/auth/oidc-status` endpoint to reflect the true state.
- **PostgreSQL Migration Permissions:** Updated migration scripts to avoid `CREATEROLE` errors on standard DB users by using `DO` blocks with graceful fallbacks.
### Major Code Refactoring:
- **Blueprint Extraction:**
- Moved admin, warranty, tag, file handling, and statistics routes into dedicated Flask Blueprints for improved maintainability.
- Introduced `file_routes.py`, `tags_routes.py`, `admin_routes.py`, `warranties_routes.py`, and `statistics_routes.py`.
- **Application Factory Pattern:**
- Adopted the Flask Application Factory pattern using `create_app()` for modular, testable architecture.
- Added `config.py`, centralized `extensions.py`, and simplified `app.py` to a minimal entry point.
### Additional Fixes:
- Restored missing `/api/currencies` and `/api/settings/global-view-status` endpoints.
- Fixed status page warranty expansion and toast notification issues.
- Updated frontend logic to properly show Paperless-ngx documents on warranty cards and status page.
### Impact:
- Configuration via Docker `.env` now works reliably.
- Application can now run on standard PostgreSQL setups.
- Codebase is modular and easier to maintain.
- Frontend issues related to missing endpoints and document visibility are resolved.
This major update introduces several significant new features, critical bug fixes, and key enhancements across the application, focusing on user customization, administration, and system stability.
New Features
Currency Position Control: Allows users to choose whether the currency symbol appears on the left or right of numbers. This setting is applied universally across the app, including warranty cards and forms, and is saved per-user.
Super-Admin (Owner) Role: Implements an immutable Owner role for the primary administrator, who cannot be deleted or demoted. A secure ownership transfer process has been added to the admin settings.
OIDC-Only Login Mode: Adds a site-wide setting to enforce OIDC-only authentication, which hides the traditional username/password login form to streamline SSO environments.
Product Age Tracking & Sorting: Displays the age of a product (e.g., "2 years, 3 months") on warranty cards and adds a new "Sort by Age" option to organize items by their purchase date.
Global View Photo Access: Permits users to view product photos on warranties shared in global view, while ensuring other sensitive documents like invoices remain private to the owner.
Persistent View Scope: The application now remembers the user's last selected view (Global or Personal) and automatically loads the appropriate data on page refresh for a seamless experience.
Export Debug Tools: Introduces a comprehensive debugging system, including a new debug page and API endpoint, to help administrators troubleshoot and verify warranty exports.
Key Enhancements
About Page Redesign: A complete visual overhaul of the "About" page with a modern, card-based layout, prominent community links, and improved branding.
Flexible Apprise Notifications: Admins can now configure Apprise notifications to be a single global summary or sent as per-user messages. Additionally, the scope can be set to include warranties from all users or only the admin's warranties.
Larger Product Photo Thumbnails: Increased the size of product photo thumbnails in all views (grid, list, and table) for better product visibility.
Smart Currency Default: The "Add Warranty" form now intelligently defaults to the user's preferred currency setting, rather than always using USD.
Bug Fixes
Critical OIDC & Proxy Fixes: Resolved two major OIDC issues: a RecursionError with gevent workers and incorrect http:// callback URLs when behind an HTTPS reverse proxy, enabling reliable OIDC login.
Critical User Preferences Persistence: Fixed a bug where user settings for currency symbol and date format were not being saved correctly to the database.
Apprise & Notification Settings: Corrected an issue preventing user notification channel and Apprise timing settings from saving. The Apprise message format is now standardized, and the admin UI has been cleaned up.
CSV Import Currency: Ensured that warranties imported via CSV correctly use the user's preferred currency instead of defaulting to USD.
Maintenance & Refactoring
Authentication System Refactoring: Migrated all authentication-related routes from app.py into a dedicated Flask Blueprint (auth_routes.py) to improve code organization and maintainability.
Legacy Code Cleanup: Removed over 290 lines of orphaned and commented-out legacy OIDC code from the main application file.
### Major Features
- **Public Global Warranty View:** All authenticated users can now view global warranties. Admins retain full control; regular users get read-only access to others’ warranties.
- **Global View Admin Controls:** Admins can now toggle global view availability and limit it to admins only via site settings.
- **Global Status Dashboard View:** Extended global view to warranty statistics and dashboards with full permissions enforcement.
- **Apprise Push Notifications:** Integrated Apprise for multi-platform warranty alerts with extensive backend and frontend support (80+ services).
- **Warranty Type Filtering/Sorting:** Introduced dynamic, case-insensitive filtering and sorting by warranty type on the main page.
- **Admin Global Warranty View:** Dedicated admin tools and UI for viewing all warranties with enhanced styling and user info.
### UX/UI Enhancements
- **Product Photo Thumbnails:** Added interactive, responsive photo previews on warranty cards across all views.
- **Updated Footer Links:** All "Powered by Warracker" footers now link to the official website (`https://warracker.com`).
### Fixes and Stability Improvements
- **Status Dashboard Chart Fixes:** Resolved canvas reuse errors and chart switching issues.
- **CSS Cache Busting:** Ensured consistent styling across domain/IP access by versioning CSS/JS and updating service worker.
- **Settings Access Fixes:** Regular users can now access the settings page without triggering admin-only API calls.
- **Settings Persistence Fixes:** Addressed major frontend/backend issues preventing correct saving/loading of user preferences.
- **Notification Timing Overhaul:** Rewrote logic for precise notification delivery and implemented duplicate prevention.
### Security and Technical Enhancements
- Global view maintains secure ownership enforcement.
- Improved permission checks, graceful degradation, and responsive design across all new features.