Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions aw_watcher_window/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,19 @@ def main():
client.wait_for_start()

with client:
# On macOS, the swift strategy uses a native binary that bypasses Python filtering.
# Fall back to jxa if title exclusion is configured, so exclude_title/exclude_titles work.
if (
sys.platform == "darwin"
and args.strategy == "swift"
and (args.exclude_title or args.exclude_titles)
):
Comment on lines +77 to +81
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fallback condition at line 80 checks args.exclude_titles with a plain truthiness test, but the actual filtering at lines 119–120 excludes None entries with if title is not None. This means if a user's TOML config contains exclude_titles = [null] (or produces a list of only None values), the fallback will trigger unnecessarily — the list evaluates as truthy even though no actual patterns will be active after filtering.

To align the fallback guard with the actual runtime behavior in heartbeat_loop, filter out None entries before testing truthiness:

Suggested change
if (
sys.platform == "darwin"
and args.strategy == "swift"
and (args.exclude_title or args.exclude_titles)
):
if (
sys.platform == "darwin"
and args.strategy == "swift"
and (args.exclude_title or any(t is not None for t in args.exclude_titles))
):

logger.warning(
"exclude_title/exclude_titles is not supported with the swift strategy; "
"falling back to jxa strategy"
)
args.strategy = "jxa"

if sys.platform == "darwin" and args.strategy == "swift":
logger.info("Using swift strategy, calling out to swift binary")
binpath = os.path.join(
Expand Down
Loading