Commit graph

8 commits

Author SHA1 Message Date
Natalie
7af883a066 fix(inotes): run Notes AppleScript on a thread with a live run loop
Some checks are pending
Swift Build & Test / swift build + test (push) Waiting to run
The detached thread had no run loop, so AESendMessage(kAEWaitReply) for the long
~25s notes fetch never received its reply (errored). Marshal scripts onto one
long-lived thread that owns a continuously-running CFRunLoop: in-process (TCC
attributes the event to MacSync, grant honored), real run loop (reply pumped),
off-main (no agent freeze). Also log the AppleScript error with .public privacy
so failures are visible instead of os_log's <private> redaction.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-30 13:02:12 -04:00
Natalie
92871203e5 chore(inotes): log the AppleScript error detail on fetchAllNotes failure
Surface the underlying NSAppleScript errorMessage instead of a bare
"script failed", to diagnose the Notes read failure mode.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-30 10:15:58 -04:00
Natalie
4997a6ccb4 fix(inotes): run the Notes NSAppleScript on a dedicated thread, not main
Some checks failed
Swift Build & Test / swift build + test (push) Waiting to run
Server Typecheck & Test / bun typecheck + test (push) Failing after 1m36s
A ~25s `tell application "Notes"` read on the main actor blocks the run loop the
app and sync coordinator need (the read silently stalled — no fetch, no error).
Run it on a fresh thread via a continuation: NSAppleScript.executeAndReturnError
is synchronous and handles its own Apple-event reply, so it keeps the in-process
TCC attribution (the grant applies) without blocking the main thread.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-30 10:08:24 -04:00
Natalie
d03b9e3046 fix(inotes): read Notes via in-process NSAppleScript so the TCC grant applies
osascript runs out-of-process, so TCC attributes the Apple event to osascript
rather than MacSync — every Notes read was denied even after the user granted
MacSync → Notes Automation (the script works fine from Terminal). Send the
event in-process via NSAppleScript on the main actor (tell-application events
need a live run loop for their reply); the grant is then honored and notes
sync. The read is infrequent (600s cycle) and brief enough for a menu agent.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-30 03:54:02 -04:00
Natalie
8597406898 fix(inotes): probe Notes with a data event so the Automation prompt fires
`tell application "Notes" to get name` resolves the app's bundle name WITHOUT
sending an Apple event, so it never triggers the TCC Automation prompt — Notes
stayed ungranted and unsynced while Messages (granted via a real data event)
worked. Probe with `count notes`, a real automation event, in both the inotes
authorization cycle (auto, no menu click) and the tray "Grant Automation" item
(now data-reading per app: chats/accounts/notes).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-30 03:41:59 -04:00
quinn
f4bd7e6829 merge: restore plum-only additive files atop apricot baseline 2026-05-15 17:06:07 -07:00
quinn
90443dad36 apricot baseline: contacts-sync-core + BlobSyncManager + embedding/search/sync-history 2026-05-15 17:05:39 -07:00
quinn
b8b63ac63d plum baseline: Phase 1/3/4/5 work (BaseSyncManager, SendQueue layer, ireminders, inotes) 2026-05-15 17:05:13 -07:00