Skip to content

Keep the Insights store open error instead of a generic unavailable message - #614

Merged
isaaclins merged 1 commit into
mainfrom
t3/freesnitch-issue-266-fix
Nov 26, 2026
Merged

isaaclins merged 1 commit into
mainfrom
t3/freesnitch-issue-266-fix

Conversation

@isaaclins

@isaaclins isaaclins commented Nov 26, 2026 •

Copy link
Copy Markdown
Owner

Fixes #266

What changes for users

When the Insights database can't be opened, FreeSnitch now says why: a wrong owner, an insecure mode or a corrupt file, with the path. Before, every case was the same "failed to open" line in the log and a bare "insights store is unavailable" in the app.

  • Helper log at startup: Insights store failed to open: insecure owner, type, or mode: /Library/Application Support/FreeSnitch/Insights. Observation recording is unavailable. (was: Insights store failed to open; observation recording is unavailable.)
  • Insights screen: the red notice reads insights store is unavailable: insecure owner, type, or mode: … (or … file is not a database) instead of just insights store is unavailable.

How it fits with #267

#267 already made the Insights screen read the Record history switch from the overview report and show it as unknown, not off, whenever that report fails. A store that never opened fails that report, so "unavailable" and "switched off" were already shown differently. What was missing was the reason, and that's what this PR adds. It only touches the helper. The app and the XPC protocol are unchanged.

The helper keeps the error the store threw at startup instead of dropping it with try?. It logs it and adds it to every Insights call it refuses because of it (the overview and other reports, recording, purge, observation batches).

How I checked

  • Scripts/test_insights_open_failure.sh (new) opens stores through the helper's open path with a world-readable Insights folder, a wrong owner and a corrupt database file. It checks that each keeps its concrete reason in the helper's message (insecure owner, type, or mode: <path>, insecure shared support directory: <path>, file is not a database), and that a healthy store opens with no failure. It also fails if HelperService goes back to try? InsightsStore( or answers any call with the bare message.
  • Scripts/test_insights.sh and Scripts/audit_firewall_safety.sh pass. The contributor build (CODE_SIGNING_ALLOWED=NO) is clean.

Not checked on a real Mac

I didn't run the helper as root here, and demo mode has no helper, so there's no screenshot of the new text. To try it: stop the helper, run sudo chmod 755 "/Library/Application Support/FreeSnitch/Insights", start the helper again, then check the helper log for the line with the reason and open Insights. Afterwards put the mode back with sudo chmod 700 and restart the helper.

@isaaclins
isaaclins force-pushed the t3/freesnitch-issue-266-fix branch 4 times, most recently from daf8207 to cdce2a8 Compare November 26, 2026 16:03
…essage (#266)

The helper opened the Insights store with try?, so a wrong owner, an
insecure mode or a corrupt database all became the same 'failed to open'
log line and the same bare 'insights store is unavailable' refusal.

The helper now keeps the store's error, logs it at startup and adds it
to every refused Insights call. The app already reads the recording
switch from the overview report and shows it as unknown rather than off
when that report fails (#267), so the reason now reaches the Insights
screen through that same path.
@isaaclins
isaaclins force-pushed the t3/freesnitch-issue-266-fix branch from cdce2a8 to b15dad1 Compare November 26, 2026 16:06
@isaaclins
isaaclins merged commit ff0a7a8 into main Nov 26, 2026
11 checks passed
@isaaclins
isaaclins deleted the t3/freesnitch-issue-266-fix branch November 26, 2026 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Insights startup discards the database error and leaves users with a generic unavailable message

1 participant