Comprehensive review fixes: security, performance, code quality, and UI polish
Some checks failed
Validate / Hassfest (push) Has been cancelled
Some checks failed
Validate / Hassfest (push) Has been cancelled
Backend: Fix CORS wildcard+credentials, add secret key warning, remove raw API keys from sync endpoint, fix N+1 queries in watcher/sync, fix AttributeError on event_types, delete dead scheduled.py/templates.py, add limit cap on history, re-validate server on URL/key update, apply tracking/template config IDs in update_target. HA Integration: Replace datetime.now() with dt_util.now(), fix notification queue to only remove successfully sent items, use album UUID for entity unique IDs, add shared links dirty flag and users cache hourly refresh, deduplicate _is_quiet_hours, add HTTP timeouts, cache albums in config flow, change iot_class to local_polling. Frontend: Make i18n reactive via $state (remove window.location.reload), add Modal transitions/a11y/Escape key, create ConfirmModal replacing all confirm() calls, add error handling to all pages, replace Unicode nav icons with MDI SVGs, add card hover effects, dashboard stat icons, global focus-visible styles, form slide transitions, mobile responsive bottom nav, fix password error color, add ~20 i18n keys (EN/RU). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -354,6 +354,7 @@ async def _send_queued_items(
|
||||
|
||||
items = queue.get_all()
|
||||
sent_count = 0
|
||||
sent_indices = []
|
||||
for i in indices:
|
||||
if i >= len(items):
|
||||
continue
|
||||
@@ -371,14 +372,16 @@ async def _send_queued_items(
|
||||
blocking=True,
|
||||
)
|
||||
sent_count += 1
|
||||
sent_indices.append(i)
|
||||
except Exception:
|
||||
_LOGGER.exception("Failed to send queued notification %d", i + 1)
|
||||
|
||||
# Small delay between notifications to avoid rate limiting
|
||||
await asyncio.sleep(1)
|
||||
|
||||
# Remove sent items from queue (in reverse order to preserve indices)
|
||||
await queue.async_remove_indices(sorted(indices, reverse=True))
|
||||
# Only remove successfully sent items (in reverse order to preserve indices)
|
||||
if sent_indices:
|
||||
await queue.async_remove_indices(sorted(sent_indices, reverse=True))
|
||||
_LOGGER.info("Sent %d/%d queued notifications", sent_count, len(indices))
|
||||
|
||||
|
||||
@@ -419,7 +422,7 @@ async def _async_update_listener(
|
||||
subentries_data = entry_data["subentries"]
|
||||
for subentry_data in subentries_data.values():
|
||||
subentry_data.coordinator.update_scan_interval(new_interval)
|
||||
subentry_data.coordinator._sync_client = sync_client
|
||||
subentry_data.coordinator.update_sync_client(sync_client)
|
||||
|
||||
_LOGGER.info("Updated hub options (scan_interval=%d)", new_interval)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user