Closed johnptoohey closed 4 years ago
Hi John! It seems to work for me locally! Can you share a few extra details like how you're running the tests, node / yarn version, and OS?
node: 13.3.0 ts-node: 8.5.4 OS: OSX 10.14 Tests: ts-node --files tests/* | tap-html --out jt.html Anything else that would be of use? Thanks
Just noticed that in the test report, the Test (Three way docs don't load until all changes are in") seems to be calling the Watch callbacks that are set in test ("Share a doc between two repos"). The tests call repo.Close, and I would assume that kills the registered callbacks.
Would you try yarn test
to isolate for environment issues?
I don;t see a "test" script in the package.json, but running yarn tape give me the following summary 👎 1..269
("tape": "ts-node --files node_modules/tape/bin/tape tests/*.test.ts")
Did a clean clone of the project and used Yarn to install and run tests. Everything passes now. I'm coming from a Rust/Go background, so still coming up to speed with the Node toolchains. (I originally used npm to install and run tests etc.)
My own PoC was still not working, but then I noticed that I was sharing the same "swarm" variable between the Repos. Giving each one its own instance solved the problem.
Thanks again for all your help in getting this unblocked for me.
Ah, great to hear! I'm reading between the lines here but maybe this is a sign that NPM doesn't work right now?
In my case, that seems to be true. NPM also takes longer to build the c libs and install. Yarn is much faster.
BTW Do I need to use swarm-discovery etc., to locate nodes on my network to replicate changes? I saw that in the example app, but much of that is outdated, so not sure if I should be using it.
The example app is embarrassingly bit-rotted! PushPin is the state of the art for an Electron app: https://github.com/inkandswitch/pushpin/ and for CLI: https://github.com/mjtognetti/pushpin-peer
I would be delighted to have a trivial example app to replace the ones there now so if you get a little demo going I'll gladly merge it.
Thanks for these. I'll clean up my simple PoC at the weekend, and send you a PR for it. Simple two repos using file storage and showing data merged from RepoA to RepoB.
Have a working sample ready to push. Can you add me to the project?
Great! Just fork the repo and send a PR, I'll give it a look-over and merge it as long as it works for me too.
Hi, Just found the project and it looked like a great synergy with automerge and hypercore. I'm struggling to get any code working. Projects tests (multi-repos.test.ts) fail with "extrac doc emitted and plan != count) errors. I cannot get the examples to work or even compile.
In my sample code below, my repoB never gets notified of changes made by repoA. Any help or pointers to working sample code would be greatly appreciated.
Thank you.