Skip to content

BUG: Daemon hot-reload of accounts does not tear down old IDLE watchers #1176

@andrinoff

Description

@andrinoff

Describe the bug

daemon.ReloadConfig reinitialises providers but does not stop IDLE watchers for accounts that were removed or had credentials changed. The old IDLE goroutine keeps running with a now-invalid *config.Account pointer; new mail events are tagged with a deleted account ID and the UI shows ghost notifications.

Expected behavior

On reload: diff the old vs new account set. For removed accounts, idleWatcher.Stop(accountID). For changed credentials, restart the watcher with the new account.

Why it's hard

The race window between "new providers created" and "old watchers torn down" needs to be handled without dropping new events. A clean fix probably introduces an explicit reload-token sequence.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions