fix(app): list Apple Calendar events right after grant on macOS 26#3936
Closed
louis030195 wants to merge 2 commits into
Closed
fix(app): list Apple Calendar events right after grant on macOS 26#3936louis030195 wants to merge 2 commits into
louis030195 wants to merge 2 commits into
Conversation
macOS 26's static authorizationStatusForEntityType: can keep returning a non-FullAccess value for minutes after an in-process grant. request_access() returned granted, but every subsequent read rebuilt a fresh EKEventStore, re-checked the stale static status, and hard-failed with AuthorizationDenied. A freshly connected calendar therefore returned HTTP 500 on /connections/calendar/events and listed nothing, so users re-clicked Connect in a loop until the OS cache eventually refreshed (or they relaunched). - Remember a successful grant in-process (ACCESS_GRANTED_THIS_SESSION). - Read gate: FullAccess reads; Denied/Restricted block; anything else with a grant seen this session calls reset() + refreshSourcesIfNecessary() and reads anyway instead of failing. - Add refreshSourcesIfNecessary() to the read path (the eventkit fork only refreshed on write paths, so a brand-new read store could return stale data). - Bump macOS calendar read logging debug -> info/warn and log the live auth status on failure (Windows already did this) so the next case is visible. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Collaborator
Author
|
do you know if cal work for users now? saw one user it would show events once then its gone then back etc but the computer looked overloaded 200 tabs browser so maybe it was just lag |
Contributor
@louis030195 Fixed it , #3948 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A freshly connected Apple Calendar listed nothing on macOS 26 even though the permission popup was accepted. The native events route returned HTTP 500 on every poll, so users re-clicked "Connect" in a loop.
Root cause
macOS 26's static
+[EKEventStore authorizationStatusForEntityType:]keeps returning a non-FullAccessvalue (e.g.Not Determined) for minutes after an in-process grant.request_access()returnsgranted = true, but each read rebuilds a freshEKEventStore, re-checks that stale static status, and hard-fails withAuthorizationDenied. SoGET /connections/calendar/events500s and the UI shows no events until the OS cache refreshes or the app relaunches.Confirmed from a user log bundle:
request_accesssucceeded repeatedly while the native calendar route 500'd both before and after each grant. The Google Calendar route returns 401 when unauthenticated, so it was ruled out of those 500s. v2.5.x already resets the store insidecalendar_authorize, but that instance is dropped and every read builds its own fresh store that hits the same stale static status.Fix
ACCESS_GRANTED_THIS_SESSION).FullAccessreads;Denied/Restrictedblock; anything else with a grant seen this session callsreset()+refreshSourcesIfNecessary()and reads anyway instead of failing.refreshSourcesIfNecessary()to the read path (the eventkit fork only refreshed on write paths, so a brand-new read store could return stale data even when fully authorized).debugtoinfo/warnand log the live auth status on failure (Windows already did this), so the next occurrence is visible in logs instead of silent.Files
crates/screenpipe-connect/src/calendar.rs(read gate, session flag, refresh, logging)apps/screenpipe-app-tauri/src-tauri/src/calendar.rs(publisher gate, for meeting auto-naming)Verification
cargo check -p screenpipe-connectpasses clean.pub fn access_granted_this_session().src-tauriis not a member of the root cargo workspace, so it was not separately compiled here.calendar: fetched N eventsand "granted this session, reading anyway" log lines. If it is still empty until relaunch, the data layer (not just the status cache) is gated, and the right follow-up is a "restart to finish connecting Calendar" prompt instead.Notes
calendar_statuscan still report "not connected" during the stale window, but the meeting-notes list does not depend on it (it falls back to a successful events fetch), so events still appear..github/pr-media/(matching the existing PR-media convention). Drop the second commit if you would rather not keep it in tree.🤖 Generated with Claude Code