control-channel: a matrix change resets the dial budget
This commit is contained in:
1 parent
5a9a1dd60a
commit
4e4a6d745c
2 files changed
+14
-4
No files matched your search
@@ -128,12 +128,19 @@ public final class ControlChannel: @unchecked Sendable {
|
|||||||
public func reconfigure(_ new: ChannelConfig) {
|
public func reconfigure(_ new: ChannelConfig) {
|
||||||
queue.async { [self] in
|
queue.async { [self] in
|
||||||
let full = new.needsFullReopen(comparedTo: config)
|
let full = new.needsFullReopen(comparedTo: config)
|
||||||
|
let matrixChanged = new.matrixNames != config.matrixNames
|
||||||
config = new
|
config = new
|
||||||
if full {
|
guard !full else {
|
||||||
reopen()
|
reopen()
|
||||||
} else {
|
return
|
||||||
updateClients(now: monotonicNow())
|
|
||||||
}
|
}
|
||||||
|
if matrixChanged {
|
||||||
|
// Editing the matrix is a reconnect trigger: a name added after
|
||||||
|
// the connect budget expired must get its own 30 s to answer.
|
||||||
|
dialers.removeAll()
|
||||||
|
dialDeadline = monotonicNow() + ControlChannel.connectTimeout
|
||||||
|
}
|
||||||
|
updateClients(now: monotonicNow())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -67,7 +67,10 @@ No packet is interpreted here.
|
|||||||
- **Reconnect triggers** (§3.3): `NWPathMonitor` status change, an
|
- **Reconnect triggers** (§3.3): `NWPathMonitor` status change, an
|
||||||
explicit `reopenAll()` (the app calls it on wake, display change and
|
explicit `reopenAll()` (the app calls it on wake, display change and
|
||||||
the reconnect hotkey), a connection reset, and the settings change of
|
the reconnect hotkey), a connection reset, and the settings change of
|
||||||
key/port/matrix (the app calls `reconfigure(_:)`).
|
key/port/matrix (the app calls `reconfigure(_:)`). A key, port, local
|
||||||
|
name or local id change reopens everything; a matrix change clears the
|
||||||
|
dial state and grants a fresh 30 s budget, so a slot edited after the
|
||||||
|
budget expired is actually dialled.
|
||||||
- **Ticks**: the channel runs one 100 ms `DispatchSourceTimer` that
|
- **Ticks**: the channel runs one 100 ms `DispatchSourceTimer` that
|
||||||
calls `Session.tick(now:userActive:)` on every connection (the app
|
calls `Session.tick(now:userActive:)` on every connection (the app
|
||||||
reports `userActive` via `noteUserActivity()`), drains outboxes and
|
reports `userActive` via `noteUserActivity()`), drains outboxes and
|
||||||
|
|||||||
Reference in new issue
Block a user