Drop App Groups, share via keychain access group only

Apple's ASC API doesn't expose App Group registration cleanly, and the
keychain access group on its own (`$(AppIdentifierPrefix)<bundleId>`)
already gives the share extension and container app a shared store for
the base URL + token. The repo cache moves to per-process UserDefaults —
the extension fetches/caches it on first share if empty.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Claude
2026-04-26 23:20:36 -05:00
parent 74e03c4e10
commit 0a835f6be0
4 changed files with 9 additions and 19 deletions
+6 -6
View File
@@ -9,7 +9,7 @@ enum RepoCache {
static var repos: [GiteaRepo] {
get {
guard let data = AppSettings.sharedDefaults.data(forKey: listKey) else { return [] }
guard let data = AppSettings.localDefaults.data(forKey: listKey) else { return [] }
let decoder = JSONDecoder()
decoder.dateDecodingStrategy = .iso8601
return (try? decoder.decode([GiteaRepo].self, from: data)) ?? []
@@ -18,14 +18,14 @@ enum RepoCache {
let encoder = JSONEncoder()
encoder.dateEncodingStrategy = .iso8601
if let data = try? encoder.encode(newValue) {
AppSettings.sharedDefaults.set(data, forKey: listKey)
AppSettings.sharedDefaults.set(Date(), forKey: listFetchedKey)
AppSettings.localDefaults.set(data, forKey: listKey)
AppSettings.localDefaults.set(Date(), forKey: listFetchedKey)
}
}
}
static var fetchedAt: Date? {
AppSettings.sharedDefaults.object(forKey: listFetchedKey) as? Date
AppSettings.localDefaults.object(forKey: listFetchedKey) as? Date
}
static var isStale: Bool {
@@ -34,13 +34,13 @@ enum RepoCache {
}
static var recentFullNames: [String] {
AppSettings.sharedDefaults.stringArray(forKey: recentsKey) ?? []
AppSettings.localDefaults.stringArray(forKey: recentsKey) ?? []
}
static func touch(_ fullName: String) {
var current = recentFullNames.filter { $0 != fullName }
current.insert(fullName, at: 0)
if current.count > recentsCap { current = Array(current.prefix(recentsCap)) }
AppSettings.sharedDefaults.set(current, forKey: recentsKey)
AppSettings.localDefaults.set(current, forKey: recentsKey)
}
}