Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notifications are not shown on macOS caused by #3651 #3892

Merged
merged 1 commit into from
Nov 7, 2019
Merged

Conversation

tmancey
Copy link
Collaborator

@tmancey tmancey commented Nov 6, 2019

Fixes brave/brave-browser#6786
Requires: #3084
Requires: #3907

Submitter Checklist:

Test Plan:

Confirm ad notifications are displayed on macOS (only affects macOS)

Reviewer Checklist:

  • New files have MPL-2.0 license header.
  • Request a security/privacy review as needed.
  • Adequate test coverage exists to prevent regressions
  • Verify test plan is specified in PR before merging to source

After-merge Checklist:

  • The associated issue milestone is set to the smallest version that the
    changes has landed on.
  • All relevant documentation has been updated.

dispatch_semaphore_signal(semaphore);
}];

dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER);
Copy link
Collaborator

@kylehickinson kylehickinson Nov 6, 2019

Choose a reason for hiding this comment

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

This (and the same usage below) is fine for now, but we should move away from this ASAP, as if Apple change the callbacks from UNUserNotificationCenter to execute async on main thread, this wait will block main thread and thus this process forever.

It is explicitly stated on this APIs that they may execute on a background thread: https://developer.apple.com/documentation/usernotifications/unusernotificationcenter/1649527-requestauthorizationwithoptions?language=objc

However this API has been executed on a background thread in iOS for years now, so though its unlikely to be changed any time soon, it can always happen as it doesn't explicitly say it will always run on a background thread

Fine with this as long as its a temporary solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Notifications are not shown on macOS caused by #3651 (Nightly only)
3 participants