Open guillemcordoba opened 2 years ago
I was thinking how one could implement backlinking of attachments and I think it would be difficult with the approach above since the information of the linking is stored only in the "receiving" applet and it would seem cumbersome to add that information also to the originating applet. I came up with an alternative pattern but I remembered our discussion and I think this approach would probably have limitations on federation of attachments or at least make it more complicated:
sequenceDiagram
EventsApplet->>We UI (drawer): emit('record-selected', payload: { AnyDhtHash })
We UI (drawer)->>We attachment DNA: get_attachments_for_hash()
We attachment DNA->>We UI (drawer): Vec<(DnaHash, AnyDhtHash)>
We UI (drawer)->>We attachment DNA: attached_by_for_hash()<br>(backlinking)
We attachment DNA->>We UI (drawer): Vec<(DnaHash, AnyDhtHash)>
We UI (drawer)->>TheadApplet: render_entry(hash)
We UI (drawer)->>NoteApplet: render_entry(hash)
We UI (drawer)->>We attachment DNA: add_attachment_for_hash()
Mmm I think the information should be in the two applets, and they can handle that info in the way that they want... Why can't be the case with the original design?
With a general "we attachments dna" I'm also worried about migrations, read access control...
Applet functions:
Imagine an event attaching a note:
Attaching a note
Seeing the note that is attached to the event