Fix crash when a rule's target app is uninstalled, and restore the build on current SDKs - #63
Open
matijazezelj wants to merge 2 commits into
Open
matijazezelj wants to merge 2 commits into
matijazezelj wants to merge 2 commits into
Conversation
Bundle(url:) returns nil once an app is moved, renamed or uninstalled, so force-unwrapping it in RuleItem.body trapped the moment the Rules tab laid out its List — making a stale rule impossible to reach and delete. Rows for unresolved apps now render in a degraded state instead of being force-unwrapped or hidden, so they can still be edited or removed. Apply the same treatment to CFBundleName and bundleIdentifier, which are both optional in practice, and to the equivalent sites in the Apps tab, Browsers tab and the picker. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DWQa3xpkwVRtrtVh8VkQQo
The symbol survives in SwiftUI.tbd but is absent from the swiftinterface of both the macOS 26.5 and 27.0 SDKs, so the call no longer compiles against any current SDK. scrollEdgeEffectHidden(_:for:) carries the same @available(macOS 26.0, *) and slots straight into the existing guard. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DWQa3xpkwVRtrtVh8VkQQo
This was referenced Sep 11, 2026
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.
Two independent fixes. The first one currently stops
mainfrom building at all.1.
mainno longer compiles against current SDKsBrowserino/Extensions/View+ScrollEdgeDisabled.swift:16callsscrollEdgeEffectDisabled(_:for:). That API has been renamed toscrollEdgeEffectHidden(_:for:). The old symbol survives inSwiftUI.tbdfor ABI compatibility, but it is absent from the.swiftinterfaceof both the macOS 26.5 and macOS 27.0 SDKs, so the call no longer type-checks:scrollEdgeEffectHidden(_:for:)is declared@available(iOS 26.0, macOS 26.0, tvOS 26.0, watchOS 26.0, *)— identical to what the existingif #available(macOS 26.0, *)guard already checks — so it drops in with no other change.2. Crash when a rule points at an app that is no longer installed
Browserino/Views/Preferences/RulesTab.swift:47force-unwrappedBundle(url: rule.app)!.Bundle(url:)returnsnilas soon as the target app is renamed, moved or uninstalled, so the Rules tab traps the instant itsListlays that row out:I hit this when Zen Browser renamed its bundle from
Zen Browser.apptoZen.app. What makes it worse than a normal crash is that it is unrecoverable from the UI: a stale rule can only be removed from the Rules tab, and opening the Rules tab is exactly what kills the app. The only way out is editingdefaultsby hand.Rows whose app cannot be resolved now render in a degraded state instead — greyed-out name with a placeholder icon — keeping their edit affordance so the rule can be repointed or deleted:
The same treatment is applied to
CFBundleNameandbundleIdentifier— both genuinely optional in shipping app bundles — and to the equivalent sites in the Apps tab, Browsers tab and the picker. Note the Apps tab previously hid unresolvable rows behindif let, which produces the same dead end in a quieter way: an entry you can neither see nor delete.Verification
origin/mainfails with the 4 errors quoted above.RulesTabin anNSWindowseeded with a rule pointing at a non-existent bundle, so the actualNSTableViewrow-height path that produced the trace above gets exercised. Both rows lay out, nothing traps.No behaviour changes beyond the above — no reformatting, no unrelated refactors.
Disclosure
This was written with AI assistance (Claude Code). The starting point was a real crash report from my own machine, and everything above was compiled and the crash path verified at runtime before I opened this. Happy to adjust anything to taste.