Jump to content

Crash when dropping promised files to a document


Recommended Posts

I'm a macOS developer working on integration with Affinity apps using drag and drop. When using the macOS NSFilePromiseProvider api to drag a promised file to a document in any of the Affinity apps they'll crash immediately on drop.

It seems like Affinity v2 doesn't handle promised files correctly. See attachment for sample crash report.

The issue can be reproduced consistently by dragging from any app that offers file promises without also providing a direct url using `public.file-url`.

Examples:

Contacts
1. Open a document in Affinity Designer
2. Open macOS Contacts app
3. Drag a contact to the open document
=> crash

ForkLift - https://binarynights.com
1. Connect to a remote location
2. Drag a file from remote to open Affinity document
=> crash

Typeface app - https://typefaceapp.com
1. Drag a font to an open Affinity document
=> crash

Sample Code Project for NSFileProvider
See https://developer.apple.com/documentation/appkit/documents_data_and_pasteboard/supporting_drag_and_drop_through_file_promises
1. Build and run
2. Drag image to window
3. Drag image from window to open Affinity document
=> crash

Drag and drop from macOS Photos app works fine, because in addition to a file promise it also offers a url to a file on disk (`public.file-url`) and its contents (`public.jpeg`). That seems to work, but is not possible for apps that deal with data that does not exist locally yet.

For my specific use case (Typeface app) it would be great if a file promise of type `public.directory` could be rejected by the Affinity apps, because dropping folders is not supported anyway. This could for example be done by refusing the drop when implementing NSDraggingDestination


Possibly related to `af-1162` ?
Affinity Designer/Photo/Publisher 2.4.0
macOS Sonoma 14.3 

crash.txt

Link to comment
Share on other sites

  • Staff

Hi @Floor,

Thanks for reporting this. 

I've been able to replicate this and have just gotten this logged with the Developers.  It could very well be related to AF-1162 from what i can gather from reading that bug report.  Either way, this has been logged as a crash is always unwanted behaviour. 

This thread will get a reply from the Serif Info Bot when this has been resolved and if theres any feedback from the Developers, i'll update here as well :) 

Link to comment
Share on other sites

  • 3 weeks later...
  • Staff

The issue "[macOS] Crash when dropping Promised files into a document" (REF: AF-2264) has been fixed by the developers in internal build "2.4.2.2356".
This fix should soon be available as a customer beta and is planned for inclusion in the next customer release.
Customer beta builds are announced here and you can participate by following these instructions.
If you still experience this problem once you are using that build version (or later) please reply to this thread including @Affinity Info Bot to notify us.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.