ondras / my-mind

Online Mindmapping Software
https://my-mind.github.io
MIT License
3.28k stars 648 forks source link

[question] how to merge a diff when something has changed #170

Open melvincarvalho opened 1 year ago

melvincarvalho commented 1 year ago

I was going through some of the code

I was impressed by the logic in the code that allows for the merging of a diff when there are changes in Firebase. I am hoping to do something similar with a pub/sub protocol that I am working on and would like to know if there is a straightforward way to trigger a GET and MERGE for a changed resource.

For the time being, a document reload or refresh might work well enough. I would appreciate any help or guidance on this.

My logic would be:

melvincarvalho commented 1 year ago

I think I figured this out as best I can as a workaround

I made a function quickLoad which is similar to quickSave, which I export from the self executing function

I think call quickLoad when I get a sub event from the server

I think this is 1/2 the way there, I'll report back when I have merge working

melvincarvalho commented 1 year ago

I realized that all these questions are answered here: https://github.com/ondras/my-mind/issues/136

I currently have realtime merges with own DAV backend and pubsub working with my new open source project NosDAV. It's really nice, I even have an AI bot helping to co create mind maps.

Currently I've hacked it together, but I will follow the instructions to integrate it more into the code base and/or make a new backend, if that's a good idea.