Call clearStaleNodes at start of sendWantConfig (#1535)

This commit is contained in:
Mike Robbins 2026-01-04 20:28:40 -08:00 committed by GitHub
parent 575cb887b0
commit 9ca951b179
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 11 additions and 1 deletions

View file

@ -16733,6 +16733,7 @@
}
},
"Favorited and ignored nodes are always retained. Nodes without PKC keys are cleared from the app database on the schedule set by the user, nodes with PKC keys are cleared only if the interval is set to 7 days or longer. This feature only purges nodes from the app that are not stored in the device node database." : {
"extractionState" : "stale",
"localizations" : {
"de" : {
"stringUnit" : {
@ -16759,6 +16760,9 @@
}
}
}
},
"Favorited and ignored nodes are always retained. Other nodes are cleared from the app database on the schedule set by the user. (Nodes with PKC keys are always retained for at least 7 days.) This feature only purges nodes from the app that are not stored in the device node database." : {
},
"Favorites" : {
"localizations" : {

View file

@ -196,6 +196,8 @@ class AccessoryManager: ObservableObject, MqttClientProxyManagerDelegate {
Logger.transport.error("Unable to send wantConfig (config): No device connected")
return
}
_ = clearStaleNodes(nodeExpireDays: Int(UserDefaults.purgeStaleNodeDays), context: self.context)
try await withTaskCancellationHandler {
var toRadio: ToRadio = ToRadio()

View file

@ -80,6 +80,7 @@ extension UserDefaults {
case showDeviceOnboarding
case usageDataAndCrashReporting
case autoconnectOnDiscovery
case purgeStaleNodeDays
case manualConnections
case testIntEnum
}
@ -178,6 +179,9 @@ extension UserDefaults {
@UserDefault(.autoconnectOnDiscovery, defaultValue: true)
static var autoconnectOnDiscovery: Bool
@UserDefault(.purgeStaleNodeDays, defaultValue: 0)
static var purgeStaleNodeDays: Double
@UserDefault(.testIntEnum, defaultValue: .one)
static var testIntEnum: TestIntEnum

View file

@ -120,7 +120,7 @@ struct AppSettings: View {
Text("180")
}
}
Text("Favorited and ignored nodes are always retained. Nodes without PKC keys are cleared from the app database on the schedule set by the user, nodes with PKC keys are cleared only if the interval is set to 7 days or longer. This feature only purges nodes from the app that are not stored in the device node database.")
Text("Favorited and ignored nodes are always retained. Other nodes are cleared from the app database on the schedule set by the user. (Nodes with PKC keys are always retained for at least 7 days.) This feature only purges nodes from the app that are not stored in the device node database.")
.foregroundStyle(.secondary)
.font(idiom == .phone ? .caption : .callout)
}