Repository navigation
fix: resolve source app from Apple Event sender - #4
Merged
Merged
Conversation
andyzasl
added a commit
that referenced
this pull request
Oct 31, 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.
When Browserly becomes the foreground application while handling an incoming URL,
sourceApprules can fail because both URL handlers identify the foreground app as the sender. For example, a rule forru.keepcoder.Telegramcan fall through to the default browser while history recordscom.browserly.appas the source.Resolve the sender from the Apple Event's
keySenderPIDAttrusingNSRunningApplication(processIdentifier:). Both the explicit URL event handler and the application delegate callback use the same resolver; the latter readsNSAppleEventManager.currentAppleEvent. Missing, invalid, or unresolvable sender metadata produces an unknown source rather than attributing the URL to an unrelated foreground application. Existing configuration remains valid.Adds regression coverage for Telegram routing, missing events and sender attributes, invalid PIDs and descriptor types, unsigned sender PIDs (including out-of-range values), unavailable processes, and a real running application lookup.
Validation:
keySenderPIDAttrarrives astypeUInt32(magn), and the resolver now accepts it.SourceAppResolverTests: 8 tests passed.Manual end-to-end verification on macOS 27.0.1: clicking a link in Telegram now records
ru.keepcoder.Telegramas the source, matches the Telegram source-app rule, and routes to Safari. Command-line URL attribution and forwarding between Browserly instances are outside this change.