Steps to reproduce
- Drop a PDF or other filetype into an Agenda note.
- Rename the attachment with a
/
(slash) in the Name - Click the attachment and attempt to
Open
or launchQuick Look
- Nothing happens
Console Logs when clicking Open
default 17:25:57.675888 -0700 Agenda open on /var/folders/cd/dbl7k8zj5d99_wx_8dv1n44w0000gq/T/com.momenta.agenda.macos/TemporaryItems/(A Document Being Saved By Agenda 47)/Business Card /a.png: No such file or directory
default 17:25:57.681776 -0700 Agenda E SectionTextViewEditor.swift(1112) : temporaryCopyOfAttachmentFile(withInfo:) : Could not copy item: Error Domain=NSCocoaErrorDomain Code=4 "The file “4367A8F4-ECF8-4FFA-B2FC-0E2219284CF3.png” doesn’t exist." UserInfo={NSSourceFilePathErrorKey=/Users/evan/Library/Containers/com.momenta.agenda.macos/Data/Documents/Agenda/Stores/1EF90875-6BFF-41D6-938D-0A48972C9D75.agenda-document/Blobs/4367A8F4-ECF8-4FFA-B2FC-0E2219284CF3.png, NSUserStringVariant=(
Copy
), NSDestinationFilePath=/var/folders/cd/dbl7k8zj5d99_wx_8dv1n44w0000gq/T/com.momenta.agenda.macos/TemporaryItems/(A Document Being Saved By Agenda 47)/Business Card /a.png, NSFilePath=/Users/evan/Library/Containers/com.momenta.agenda.macos/Data/Documents/Agenda/Stores/1EF90875-6BFF-41D6-938D-0A48972C9D75.agenda-document/Blobs/4367A8F4-ECF8-4FFA-B2FC-0E2219284CF3.png, NSUnderlyingError=0x600003b92cd0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
What I expected
Either:
-
/
or:
should not be permitted in the “attachment name" - “attachment names” with a
/
or:
should be sanitized/mapped accordingly for saving within the filesystem
See: iphone - Replace multiple characters in a string in Objective-C? - Stack Overflow
ruby - Colon (:) appears as forward slash (/) when creating file name - Stack Overflow -
Name
s only ever exist as metadata, and the filenames are GUIDs. Exports/Shares would still have to be sanitized.
Note that :
does actually work as currently implemented, and shows up as a /
in the Finder GUI, but this is probably undesired behavior.
Diagnostics
- Agenda version: 5.5 (PDL)
- OS X version: Version 10.14.5 (Build 18F132)
- AppKit version: 1671.5
- Device type: MacBookPro12,1
- Projects: 4
- Sync: Enabled
- Other devices: 2