Fix duration overflow, expiry-warned resets, DICT control-char injection, and HostServ TAKE forbid recheck

This commit is contained in:
Jean Chevronnet 2026-07-19 13:24:46 +00:00
parent 68df1e7078
commit d833dc28f0
No known key found for this signature in database
5 changed files with 20 additions and 2 deletions

View file

@ -734,6 +734,7 @@ impl Db {
let _ = self.log.append(Event::AccountSeen { account: account.to_string(), ts: now });
if let Some(a) = self.accounts.get_mut(&k) {
a.last_seen = a.last_seen.max(now);
a.expiry_warned = false; // mirror the AccountSeen fold, or a re-active account never re-warns
}
}
}
@ -747,6 +748,7 @@ impl Db {
let _ = self.log.append(Event::ChannelUsed { channel: channel.to_string(), ts: now });
if let Some(c) = self.channels.get_mut(&k) {
c.last_used = c.last_used.max(now);
c.expiry_warned = false; // mirror the ChannelUsed fold, or a re-active channel never re-warns
}
}
}

View file

@ -1258,6 +1258,11 @@ impl Db {
if c.noexpire {
snapshot.push(Event::ChannelNoExpire { channel: c.name.clone(), on: true });
}
if c.expiry_warned {
// Preserve the "warning already sent" flag, or compaction re-arms it
// and the idle channel is warned again on the next sweep.
snapshot.push(Event::ChannelExpiryWarned { channel: c.name.clone() });
}
if c.settings != ChanSettings::default() {
snapshot.push(Event::ChannelSettingsSet { channel: c.name.clone(), settings: c.settings });
}