Channels no longer removed from config despite chansaver being loaded #505

Closed
opened 2026-10-05 04:25:48 +02:00 by adam · 2 comments
Owner

The chansaver module is loaded, this causes the channels I join to be added in znc.conf, however, when I part these channels again, these channels are no longer removed from the config. A workaround I discovered is to do /znc saveconfig every time I part a channel to make sure it gets removed from the config, because when you kill the znc process and restart znc, you will be joined to the parted channels again if you didn't do the aforementioned workaround.

The chansaver module is loaded, this causes the channels I join to be added in znc.conf, however, when I part these channels again, these channels are no longer removed from the config. A workaround I discovered is to do `/znc saveconfig` every time I part a channel to make sure it gets removed from the config, because when you kill the znc process and restart znc, you will be joined to the parted channels again if you didn't do the aforementioned workaround. <!-- github-sync-id:65093876 -->
adam closed this issue 2026-10-05 04:25:48 +02:00
Author
Owner

I'm affected by this too.

I'm affected by this too. <!-- github-comment-id:88280706 -->
Author
Owner

Found the problem. It was introduced by commit c424bd7, specifically line 647 of Chan.cpp. That commit is part of PR #705, which refactors chansaver to use scheduled config writes. Line 647 causes writes to not be scheduled if removing a channel from the config file. It probably exists by virtue of being pasted from line 638, which serves to prevent scheduling writes if the key is changed but the channel isn't supposed to be in the config file anyway.

Found the problem. It was introduced by commit c424bd7, specifically [line 647 of Chan.cpp](https://github.com/znc/znc/blob/c424bd7acad08677f6f6140010804ef0f66ade05/src/Chan.cpp#L647). That commit is part of PR #705, which refactors chansaver to use scheduled config writes. Line 647 causes writes to not be scheduled if removing a channel from the config file. It probably exists by virtue of being pasted from [line 638](https://github.com/znc/znc/blob/c424bd7acad08677f6f6140010804ef0f66ade05/src/Chan.cpp#L638), which serves to prevent scheduling writes if the key is changed but the channel isn't supposed to be in the config file anyway. <!-- github-comment-id:88285119 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/znc#505