Move inputParser inside task scope to avoid races.

This commit is contained in:
Max Goedjen
2026-03-09 16:46:50 -07:00
parent 4a8491edf2
commit fee2ec41fa

View File

@@ -35,9 +35,9 @@ class AppDelegate: NSObject, NSApplicationDelegate {
func applicationDidFinishLaunching(_ aNotification: Notification) {
logger.debug("SecretAgent finished launching")
Task {
let inputParser = try await XPCAgentInputParser()
for await session in socketController.sessions {
Task {
let inputParser = try await XPCAgentInputParser()
do {
for await message in session.messages {
let request = try await inputParser.parse(data: message)