tl;dr Feature Request: If the file has not been save, AD / AP should prompt you to save before invoking a File > Edit in… action.
Here's a not so fun little exercise…
Start a new file in AD. Create some stuff (ideally spend a good hour making something really gorgeous). Important: Do not save your work! Now click File > Edit in Photo. AD kindly closes your file (without prompting you to save). AP now opens your (temporary) file. Now close AP. AP will warn you that the file is unsaved… BUT since you haven't actually made any changes in AP, you figure that there is nothing to save - right? Click 'No' and AP graciously closes the file. Now neither AD not AP have any record of the file ever existing, and your work is gone.
OK - it is a rather convoluted example, and yes it is to some degree my fault, but I do think Affinity ought to try to save you from your own stupidity!