- assigned_to: Akarsh-Hegde
Originally created by: Akarsh-Hegde
Originally owned by: Akarsh-Hegde
Native dashboard + popover stay broken if meridian.db isn't openable at tray startup (no retry).
The pool is opened exactly once here with create_if_missing(false), and .ok() turns any failure into a permanent None managed state. On a fresh install (or after the DB is deleted), the tray can easily start before the daemon has created/migrated ~/.meridian/meridian.db — open_existing then fails and db_pool is None for the entire process lifetime.
Consequence: get_active / get_today / get_week all return Err("meridian.db is not open yet") forever. The native dashboard's load().catch(() => {}) swallows that, so data stays null and it sticks on “Loading…” with no recovery; the popover shows “DB · error”. There's no re-open path anywhere — only an app restart fixes it. The browser path doesn't have this problem because /api/* opens the DB lazily per request and recovers on its own.
Suggest opening lazily on first command use (and caching the pool once it succeeds), or re-attempting the open in the poll loop, rather than a one-shot at startup.
_Originally posted by @Akarsh-Hegde in https://github.com/Meridiona/meridian/pull/298#discussion_r3420664891_