Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
melvincarvalho opened this issue Apr 5, 2023 · 2 comments
Open

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

melvincarvalho opened this issue Apr 5, 2023 · 2 comments

Comments

@melvincarvalho
Copy link
Contributor

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:

  • on startup open websocket to relay
  • onMessage, GET the changed resource
  • after GET, merge changes and render
@melvincarvalho
Copy link
Contributor Author

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
Copy link
Contributor Author

I realized that all these questions are answered here: #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.

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

No branches or pull requests

1 participant