powerhouse-inc / connect

https://document-model-electron.vercel.app
3 stars 2 forks source link

Connect is not pushing all document operations to switchboard #298

Open gpuente opened 1 month ago

gpuente commented 1 month ago

How to reproduce this issue:

  1. Increase pullInterval value when adding a new drive (change this from the code): https://github.com/powerhouse-inc/document-model-electron/blob/staging/src/components/drive-container.tsx#L85 (you can use 50000 ms)
  2. Run connect locally and open 2 different browser (simulate 2 different clients)
  3. Add the same test drive in both clients (you can create a new fresh drive for this test)
  4. In one of the clients, create a document model document
  5. Wait until client 2 syncs and gets the document created in client 1
  6. Open the network tab in both browsers so you can see the requests being push to switchboard
  7. Open the document in both clients
  8. In client 1, change the model type to 1 and click outside the text field: you'll see in the network tab that connect is calling pushUpdatesmutation with the operation added
  9. In client 2, change the model type to 2 and click outside the text field: you'll see in the network tab that connect is calling pushUpdatesmutation with the new operation
  10. In client 2, change the model description to 3 and click outside the text field: connect is not calling pushUpdatesmutation with the new operation

Expected behavior:

In step 10, connect should call pushUpdates mutations so the operation is registered in switchboard.

Demo

Image

gpuente commented 1 month ago

Maybe this issue has some relation with this PR https://github.com/powerhouse-inc/document-model-electron/pull/159 and the debounceOperations

CallmeT-ty commented 1 month ago

@gpuente Did you have anymore insights in this issue/bug?

gpuente commented 1 month ago

Hey @CallmeT-ty ! This issue is still reproducible in staging. The main problem with this bug was that it could lead to duplicated operations, but since we are merging the fix for that by today, this bug now should have less priority.

CallmeT-ty commented 1 month ago

@gpuente Do you have an idea weither this bug is reproducable?

gpuente commented 1 month ago

@CallmeT-ty this issue is still reproducible