You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently AttachmentResolver.js misses important information about attachments, which leads to a lot of complexity in resolving attachments.
To make this more straight-forward (at least for "own attachment files" - a.k.a. the ones living in .attachments.<fileId>), we could do the following:
Add an API endpoint to get the list of files in the attachment folder along with their metadata (fileId, fileName, size, mimetype, timestamp, hasPreview, maybe even davUrl already). This endpoint would need to allow authentication both via Text session and via logged in user.
Always request this list when loading a Text document in Editor.vue (asynchronously, non-blocking).
When resolving attachments in AttachmentResolver.js, look up the attachment in the retained list and use all available information from there.
Implementation details
The list could either be stored in vuex store or the promise of the request could be passed to AttachmentResolver constructor.
When a new attachment is uploaded in Text, we either have to add it to the list in frontend, or retrieve an updated list as response and replace the list. (That might be arguments to maintain the list in vuex store 🤔)
Advantages
For "own attachments" we could return better first candidates from AttachmentResolver.
Non-image attachments would get a first candidate with type: media, resulting in fewer requests during <img> loads.
No extra requests required for getting metadata for attachments.
We would have the fileId of attachments available.
Summary
Currently
AttachmentResolver.js
misses important information about attachments, which leads to a lot of complexity in resolving attachments.To make this more straight-forward (at least for "own attachment files" - a.k.a. the ones living in
.attachments.<fileId>
), we could do the following:fileId
,fileName
,size
,mimetype
,timestamp
,hasPreview
, maybe evendavUrl
already). This endpoint would need to allow authentication both via Text session and via logged in user.Editor.vue
(asynchronously, non-blocking).AttachmentResolver.js
, look up the attachment in the retained list and use all available information from there.Implementation details
AttachmentResolver
constructor.Advantages
AttachmentResolver
.type: media
, resulting in fewer requests during<img>
loads.fileId
of attachments available.fileId
when emitting events for deleted attachments, useful in Collectives.Disadvantages
@juliushaertl @julien-nc @max-nextcloud for feedback.
The text was updated successfully, but these errors were encountered: