I am not a dev just a user. This is how I understand how Joplin handles attachments / resources. If anyone knows better please feel free to correct me.
Please note that there are many types of “metadata” such as:
Embedded metadata - Extra information embedded within the file data itself such as EXIF camera data, Word data such as author, last printed date etc.
Filesystem metadata - Filename, modified / created / access dates, location of the actual file data on the storage media etc. This is stored in the filesystem and outside the actual file data.
Application metadata - Other information stored about a file by a specific application for its own purposes, so that application can manage that file. This would include programs such as Joplin and is also stored outside the actual file data.
Does it strip the metadata?
If you are referring to embedded metadata, like EXIF data, no. I have read a post where @laurent states that Joplin does not do anything to a file attached as a resource.
Preserve all the original?
Preserve “Original” embedded metadata within the copied file? Yes, as above.
Add any of its own?
Joplin does maintain its own application metadata for attached files but these are Joplin database records. It is not embedded into the file data of the Joplin copy itself. This application metadata appears to be information that allows Joplin to keep track of the file, what it is linked to and, if linked to nothing, whether it can be deleted after a set period of time. This is similar to filesystem metadata that exists outside of the file data itself.
Does modifying the original file change the Joplin version at all (metadata or otherwise)?
Not modifying the “original” file initially selected for attaching. When you attach a file to a Joplin note you are attaching a copy made in the Joplin resources folder (Joplin copy) and the note links to that. It is not making some kind of link between the note and the initially selected “original” file.
If you open the attached Joplin copy from within Joplin (i.e. there is a default handling application for that file type on the computer) it will watch the Joplin copy file and if the file changes it will update the Joplin copy. These changes to the Joplin copy will be synced to any other clients. This is a feature of the more recent versions of Joplin. Remember this is an update to the Joplin copy, not the “original” on your computer that you initially selected for attaching.
What about deleting it?
If you delete the “original” file you initially selected for attaching it will make no difference to the Joplin copy in the resources folder.
All filetypes treated the same?
As stated in the answer to your first question, yes. Of course for attached image files (that can be displayed) the attachment link is prefaced in markdown with a !
and this just instructs the renderer to display the image rather than just show a link.