Hello! ![]()
I’m facing an issue with a WebXDC app that uses preact and Yjs.
The problem
When running instances of the app with webxdc-dev, everything works beautifully: data gets synced rapidly and reliably.
But when running instances of the app within Delta Chat, everything falls apart: data doesn’t get synced and the instances of each user seem to go on their own.
And when closing and opening the app again, sometimes data is apparently lost, but adding something makes everything that had been seen in that instance to appear again.
I suspect it has to do with me misusing preact and/or Yjs, but I can’t see what it is.
How to reproduce the problem
This is my problematic app: Divvy Bill (yjs-collections branch). Here you have the built app, ready to share with Delta Chat: app.xdc (39.4 KB)
The problem can manifest itself by following these steps, regardless of the time you wait between them:
- User A: send the app to User B.
- User A: open the app.
- User A: join the bill.
- User A: add an expense.
- User A: leave the app open.
- User B: open the app.
- User B: join the bill.
- User B: leave the app open.
After following these steps, I’ve never seen User A and User B have the same data. Data doesn’t get synced even when leaving both instances open for a while: each expense remains solely in the instance that created it.
Why does this happen?
Following these steps using webxdc-dev works as expected.
It seems to be a “me” problem
Divvy Bill is a fork of this other app: Split Bill, which does things a bit different but works perfectly fine both with webxdc-dev and within Delta Chat.
