Correcting an app policy file leaves its details hidden until FreeSnitch restarts

Open Beginner friendly
#281 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
75/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
macos, swift
Domain
backend

Research direction

Start with the cache read and write in Sources/Shared/InternetAccessPolicy.swift:177-188 and the invalid or unreadable policy handling at lines 200-231; then check how RulesManager.swift:1122-1126 uses a nil result. Reproduce the steps with an invalid JSON policy, correct it, and select the rule again. Done when its ApplicationDescription appears without restarting FreeSnitch.

Written by the indexing model from the issue text.

Description

area:gui bug priority:low status:queued type:correctness

InternetAccessPolicy.swift:177-188 caches both successful reads and nil results using cache[bundlePath] = CacheEntry(policy: policy). Invalid or unreadable files return nil at lines 208-214, and there is no invalidation before the next selection. RulesManager.swift:1122-1126 omits the details when that cached result is nil, even after the file is corrected. This affects optional inspector details, not filtering; a valid alternate-format policy already works as a fallback on the initial read.

Steps

  1. Select a rule for a disposable app with an invalid InternetAccessPolicy.json and no valid plist fallback.
  2. Correct the JSON in place to a valid policy with ApplicationDescription.
  3. Select the rule again.
  4. The policy details remain hidden because the cached nil result prevents another read.

Where

  • Sources/Shared/InternetAccessPolicy.swift:177-188
  • Sources/Shared/InternetAccessPolicy.swift:200-231
  • Sources/GUI/Views/RulesManager.swift:1122-1126

Done when: Corrected app policy metadata becomes visible without restarting FreeSnitch.

Related: #250

I found this reading the code.

Dominant language
Swift
Stars
49
Forks
5
Avg merge
16h 48m
Merged PRs (30d)
82

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from isaaclins/freesnitch

All issues in isaaclins/freesnitch

Similar issues

More Swift issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.