Files
OSGKeyboard/OSGKeyboardShared/Services/AppGroupConfigDarwin.swift
T
rocky a2abfc5e8c fix: keyboard stability, host-only analytics, and auto-reply dedupe
- record analytics/usage only in the host app; the extension no longer opens the
  SQLite queues, so hiding the keyboard cannot hold WAL locks (0xdead10cc)
- sync clipboard history writes across processes so deletes made on one side
  are not reverted by the other
- guard memory-relief reentrancy on controller and telemetry sides to break
  the recursive crash loop
- resolve credentials off the main thread and migrate legacy keys once per
  install, so Keychain reads cannot be caught in the suspend window
- gate Volcengine ASR ping completion to once (SIGTRAP on double resume)
- treat same-text captures as the same logical copy and dedupe auto actions
  by content fingerprint within 30s, stopping Universal Clipboard storms
- realign version line to 2.1.0 (build 110)
2026-09-25 12:14:29 +08:00

47 lines
1.6 KiB
Swift

// AppGroupConfigDarwin.swift
// OSGKeyboard · Shared
//
// Cross-process Darwin notification when App Group config changes
// (translation target, cloud-polish toggle, etc.). Lets the host app
// and keyboard extension pick up writes without waiting on the 1 Hz poll.
import Foundation
public enum AppGroupConfigDarwin {
public static let notificationName = "com.osgkeyboard.config.changed"
public static func postConfigChanged() {
CFNotificationCenterPostNotification(
CFNotificationCenterGetDarwinNotifyCenter(),
CFNotificationName(notificationName as CFString),
nil,
nil,
true
)
}
}
/// Cross-process Darwin notification for clipboard-history writes.
///
/// History is one whole-array JSON blob under a single key, so a peer holding a
/// stale in-memory copy silently reverts the other side's deletes (and drops
/// its new entries) on its next write. Every other shared surface already has a
/// notification; this one did not.
///
/// A suspended process never receives Darwin notifications, so this covers only
/// the window where both processes are alive. The host must still reload when it
/// returns to the foreground.
public enum ClipboardHistoryDarwin {
public static let notificationName = "com.osgkeyboard.clipboard.history.changed"
public static func postHistoryChanged() {
CFNotificationCenterPostNotification(
CFNotificationCenterGetDarwinNotifyCenter(),
CFNotificationName(notificationName as CFString),
nil,
nil,
true
)
}
}