mirror of
https://github.com/MarekWo/mc-webui.git
synced 2026-08-07 09:12:57 +02:00
refactor: migrate .webui_settings.json to database + fix NEW_CONTACT edge case
All settings (protected_contacts, cleanup_settings, retention_settings, manual_add_contacts) moved from .webui_settings.json file to SQLite database. Startup migration auto-imports existing file and renames it to .json.bak. Added safeguard in _on_new_contact: if firmware fires NEW_CONTACT for a contact already on the device, skip pending and log a warning. Also added diagnostic logging showing previous DB state (source, protected) when contacts reappear as pending. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -155,6 +155,13 @@ CREATE TABLE IF NOT EXISTS blocked_names (
|
||||
created_at TEXT NOT NULL DEFAULT (datetime('now'))
|
||||
);
|
||||
|
||||
-- Application settings (key-value store, replaces .webui_settings.json)
|
||||
CREATE TABLE IF NOT EXISTS app_settings (
|
||||
key TEXT PRIMARY KEY,
|
||||
value TEXT NOT NULL DEFAULT '', -- JSON-encoded value
|
||||
updated_at TEXT NOT NULL DEFAULT (datetime('now'))
|
||||
);
|
||||
|
||||
-- ============================================================
|
||||
-- Indexes
|
||||
-- ============================================================
|
||||
|
||||
Reference in New Issue
Block a user