Repository navigation
Keep the Insights store open error instead of a generic unavailable message - #614
Merged
Merged
Conversation
isaaclins
force-pushed
the
t3/freesnitch-issue-266-fix
branch
4 times, most recently
from
November 26, 2026 16:03
daf8207 to
cdce2a8
Compare
…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
force-pushed
the
t3/freesnitch-issue-266-fix
branch
from
November 26, 2026 16:06
cdce2a8 to
b15dad1
Compare
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.
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.
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 store is unavailable: insecure owner, type, or mode: …(or… file is not a database) instead of justinsights 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 ifHelperServicegoes back totry? InsightsStore(or answers any call with the bare message.Scripts/test_insights.shandScripts/audit_firewall_safety.shpass. 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 withsudo chmod 700and restart the helper.