dotnet / dotnet/macios

[FinderSync] Defining DirectoryUrls causes the extension to freeze

Open
#7,100 1 comment 0 reactions 0 assignees View on GitHub
app-extensions bug macOS
Dominant language
C#
Stars
2.9k
Forks
576
Avg merge
2d 13h
Merged PRs (30d)
96

Description

### Steps to Reproduce

1. In a FinderSync extension class, set `FIFinderSyncController.DefaultController.DirectoryUrls` in its constructor to monitor one or multiple NSUrls
2. Trigger the `GetMenu` override by either clicking the toolbar button or right-clicking in a monitored folder

### Expected Behavior

The custom menu with "Get URL" appears.

### Actual Behavior

The extension freezes as soon as it tries creating a `NSMenu` object, making further calls to `GetMenu` unresponsive.
Killing the extension in macOS Settings unblocks the `GetMenu` call and lets it process until the end before the whole extension dies.

This seems to be the same problem as #6917(and I've encountered it as well while toying with badge images), except it's much easier to trigger it through menus.

### Environment

This issue was also present before the Xcode 11 update.
```
=== Visual Studio Community 2019 for Mac ===

Version 8.3 (build 1805)
Installation UUID: da0ca64e-f3f7-48d9-bc71-126c1a8b7cec
GTK+ 2.24.23 (Raleigh theme)
Xamarin.Mac 5.16.1.24 (d16-3 / 08809f5b)

Package version: 604000198

=== Mono Framework MDK ===

Runtime:
Mono 6.4.0.198 (2019-06/fe64a4765e6) (64-bit)
Package version: 604000198

=== NuGet ===

Version : 5.3.0.6192

=== Kit SDK .NET Core ===

SDK : /usr/local/share/dotnet/sdk/3.0.100/Sdks
Versions du SDK :
3.0.100
2.1.701
SDK MSBuild : /Library/Frameworks/Mono.framework/Versions/6.4.0/lib/mono/msbuild/Current/bin/Sdks

=== Runtime .NET Core ===

Runtime : /usr/local/share/dotnet/dotnet
Versions du runtime :
3.0.0
2.1.12

=== Xamarin.Profiler ===

Version : 1.6.12.26
Emplacement : /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Updater ===

Version : 11

=== Apple Developer Tools ===

Xcode 11.0 (14936)
Build 11A420a

=== Xamarin.Mac ===

Version: 6.2.0.42 (Visual Studio Community)
Hash: 5e8a208b
Branch: d16-3
Build date: 2019-09-17 14:19:30-0400

=== Xamarin.Android ===

Non installé

=== Microsoft Mobile OpenJDK ===

Java SDK: Introuvable

Code EPL d'Android Designer disponible ici :
https://github.com/xamarin/AndroidDesigner.EPL

=== Android SDK Manager ===

Version: 1.4.0.65
Hash: c33b107
Branch: remotes/origin/d16-3
Build date: 2019-09-19 20:42:44 UTC

=== Android Device Manager ===

Version: 1.2.0.115
Hash: 724ea69
Branch: remotes/origin/d16-3
Build date: 2019-09-19 20:43:06 UTC

=== Xamarin Inspector ===

Version: 1.4.3
Hash: db27525
Branch: 1.4-release
Build date: Mon, 09 Jul 2018 21:20:18 GMT
Client compatibility: 1

=== Xamarin.iOS ===

Xamarin.iOS not installed.
Can't find mtouch or the Version file at /Library/Frameworks/Xamarin.iOS.framework/Versions/Current.

=== Xamarin Designer ===

Version: 16.3.0.230
Hash: bbe518670
Branch: remotes/origin/d16-3-xcode11
Build date: 2019-09-17 18:39:30 UTC

=== Build Information ===

Release ID: 803001805
Git revision: df50511ccb08d4d84a53939f1d7fc0b40cbb0ee1
Build date: 2019-09-20 16:10:55+00
Build branch: release-8.3
Xamarin extensions: da8d448cd65f2cc87c5e6dc7e2c2ca7b96d20c72

=== Operating System ===

Mac OS X 10.14.6
Darwin 18.7.0 Darwin Kernel Version 18.7.0
Tue Aug 20 16:57:14 PDT 2019
root:xnu-4903.271.2~2/RELEASE_X86_64 x86_64

```

### Build Logs

### Example Project (If Possible)

Simply setting `DirectoryUrls` in the official extension sample reproduces the problem.
I've pushed an edited version here:
https://github.com/Difegue/mac-samples/tree/bug-findersync2/ExtensionSamples

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.