Giter VIP home page Giter VIP logo

Comments (6)

heckj avatar heckj commented on August 20, 2024 1

I suspect I have this properly sorted, with updates in Automerge-swift, but to properly test it here along with automerge-repo-swift, I really need to cut a new automerge-swift release. I'll verify the solution, or continue digging, when that's done and I can iterate and test with the fixes.

from automerge-repo-swift.

heckj avatar heckj commented on August 20, 2024

watching the console/logging while I type on macOS <-websocket-> automerge-repo, as I'm typing in one of the notes fields, there's no immediate replication of content - no sync messages are being generated. I'm a bit unclear if that's in MeetingNotes, AutomergeText, or the repository, but somewhere the "hey, there's a change" signal is getting dropped, delayed significantly (longer than a few seconds), or lost

from automerge-repo-swift.

heckj avatar heckj commented on August 20, 2024

WebSocket investigation log (Mac <--websocket--> automerge-repo)

From typing a single character in an agenda-item text field:

These first two updates were from the Automerge doc's objectWillChange sink, happening almost exactly 1 second apart.
There's a debounce in this stream of 1 second, but getting two update noticifations for a single keypress is a tad unexpected.

3BwAK2fZ3Nrgn9HRBb9yvNx9xXKX ** objectWillChange (1 sec delay) **
Loading model updates
3BwAK2fZ3Nrgn9HRBb9yvNx9xXKX ** objectWillChange (1 sec delay) **
Loading model updates

It goes on to trigger a sync upstream

RESOLVE document id 3BwAK2fZ3Nrgn9HRBb9yvNx9xXKX [ready]
RESOLVED! :: 3BwAK2fZ3Nrgn9HRBb9yvNx9xXKX [ready]
Providing stored sync state for doc 3BwAK2fZ3Nrgn9HRBb9yvNx9xXKX
REPONET: sending message on AutomergeRepo.WebSocketProvider to Optional("storage-server-sync-automerge-org")
REPONET: sending message on AutomergeRepo.PeerToPeerProvider to Optional("storage-server-sync-automerge-org")
Sending SYNC[documentId: 3BwAK2fZ3Nrgn9HRBb9yvNx9xXKX, sender: 16C39119-27E3-4BB9-8905-DDE4DD3CB8FD, target: storage-server-sync-automerge-org, data: 247 bytes] to peer storage-server-sync-automerge-org
Unable to find a connection to peer storage-server-sync-automerge-org
WebSocket received: SYNC[documentId: 3BwAK2fZ3Nrgn9HRBb9yvNx9xXKX, sender: storage-server-sync-automerge-org, target: 16C39119-27E3-4BB9-8905-DDE4DD3CB8FD, data: 71 bytes]
REPONET: received event from network adapter: NetworkAdapterEvents.message[SYNC[documentId: 3BwAK2fZ3Nrgn9HRBb9yvNx9xXKX, sender: storage-server-sync-automerge-org, target: 16C39119-27E3-4BB9-8905-DDE4DD3CB8FD, data: 71 bytes]]
PEER: 16C39119-27E3-4BB9-8905-DDE4DD3CB8FD - handling a sync msg from storage-server-sync-automerge-org to 16C39119-27E3-4BB9-8905-DDE4DD3CB8FD
 - Sync request received for document 3BwAK2fZ3Nrgn9HRBb9yvNx9xXKX
 - working on handle for 3BwAK2fZ3Nrgn9HRBb9yvNx9xXKX, state: ready
Providing stored sync state for doc 3BwAK2fZ3Nrgn9HRBb9yvNx9xXKX

And then we see another objectWillChange from the document, which I thought was also unexpected, but looks like it may have been triggered internally to the repo. I suspect I've got some extra change notifications in the repo doc-resolve process that may be pushed extra notifications:

3BwAK2fZ3Nrgn9HRBb9yvNx9xXKX ** objectWillChange (1 sec delay) **
Loading model updates
Updated contents of document 3BwAK2fZ3Nrgn9HRBb9yvNx9xXKX, state: ready
Storing updated sync state for doc 3BwAK2fZ3Nrgn9HRBb9yvNx9xXKX and peer storage-server-sync-automerge-org.
RESOLVE document id 3BwAK2fZ3Nrgn9HRBb9yvNx9xXKX [ready]
RESOLVED! :: 3BwAK2fZ3Nrgn9HRBb9yvNx9xXKX [ready]
Providing stored sync state for doc 3BwAK2fZ3Nrgn9HRBb9yvNx9xXKX
3BwAK2fZ3Nrgn9HRBb9yvNx9xXKX ** objectWillChange (1 sec delay) **
Loading model updates

from automerge-repo-swift.

heckj avatar heckj commented on August 20, 2024

Thread on discord highlighted a possible avenue to track discrete sets of patches after applying changes - the diff API. That's not (yet) wired through to the Swift library, so I've opened an issue (automerge/automerge-swift#148) on that repo to wire that up for potential use - including in solving this issue, or related issues in Automerge-swift that aren't efficiently propagating change notifications.

from automerge-repo-swift.

heckj avatar heckj commented on August 20, 2024

I found at least one place there's a flaw - logged as automerge/automerge-swift#149, AutomergeText doesn't have any direct means to report its changed when an underlying doc changed. In the previous setup in MeetingNotes, I was signaling updates from the coordinator (now repo), and all those places really need to be refined to reflect changes on the Automerge document, or derive a change from that notification.

from automerge-repo-swift.

heckj avatar heckj commented on August 20, 2024

I have a first cut of this resolved with automerge/automerge-swift#150, but I'll need to cut a full release of automerge-swift to verify that resolves the problems I'm seeing with MeetingNotes, and to establish tests that validate the changes signals propogate as expected.

The implementation was the worst version possible, just to verify that was the issue, and there's pending work to "make that better" with automerge/automerge-swift#151 and automerge/automerge-swift#152

from automerge-repo-swift.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.