Skip to content

Conversation

@cheywood
Copy link

@cheywood cheywood commented Sep 8, 2025

  • Attachments are stored in note-specific folder
  • Attachment filenames are retained

This mirrors the behaviour for attachments created in the web UI, bringing the following benefits:

  • Attachments get deleted (edit: and moved) along with the note
  • Attachments don't clutter the directory alongside the note
  • Non WYSIWIG editors which consume the API provide a better experience (via filenames not being replaced by random strings)
  • Consistency with web

Most of the code is based on what's used in Text.

If the API wasn't already public I would switch the name of the return element for image creation to path (from filename). As there likely isn't any project consuming the API yet this may not be a bad idea.

Addresses part of #1623.

- Attachments are stored in note-specific folder
- Attachment filenames are retained

This mirrors the behaviour for attachments created in the web UI.
@cheywood cheywood force-pushed the improve-attachment-storage branch from 3c4d132 to a4d6891 Compare September 9, 2025 05:18
Copy link
Contributor

@enjeck enjeck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this and for raising question at #1623. I need time to read through the previous discussions when the current API was implemented before I can properly review this

@cheywood
Copy link
Author

Thanks @enjeck! 🙏

Once this is resolved I'll get a release of Iotas out using the API :)

@cheywood
Copy link
Author

Oh hrmm yeah reading back through the discussion I picked up that this impacts moving notes between categories too; without this fix the attachments are left in the previous location, disconnected from the note.

@enjeck
Copy link
Contributor

enjeck commented Oct 31, 2025

I picked up that this impacts moving notes between categories too; without this fix the attachments are left in the previous location, disconnected from the note.

Yes, also previously reported at #1470

Copy link
Contributor

@enjeck enjeck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like I mentioned at #1623 (comment), I like the idea of using the original file name instead of a random text. But concerned about the new link structure. Apart from the concerns with using the file ID, I wonder how backwards compatible it is. I wonder if it's easier to just keep the existing struture in the meantime and instead explore moving things around when the category is changed.

@cheywood
Copy link
Author

cheywood commented Nov 1, 2025

Like I mentioned at #1623 (comment), I like the idea of using the original file name instead of a random text. But concerned about the new link structure. Apart from the concerns with using the file ID, I wonder how backwards compatible it is. I wonder if it's easier to just keep the existing struture in the meantime and instead explore moving things around when the category is changed.

Responded over at #1623

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants