replication occurs without errors, but documents aren't propagated
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 748
- Forks
- 56
- PR merge metrics
- No merged PRs in 30d
Description
I'm trying to replicate the documents between two or more remote instances of the hyperdb
```js
import hyperdb from 'hyperdb'
import signalhub from 'signalhub'
import pump from 'pump'
import swarm from 'webrtc-swarm'
import wrtc from 'electron-webrtc'
let key = Buffer.from(store.key, 'base64')
let db = hyperdb(`./${storage}.db`, key, {
firstNode: true
})
db.on('ready', () => {
let uuid = db.local.key.toString('hex')
console.log('target: ', uuid)
let channel = db.discoveryKey.toString('hex')
let hub = signalhub(channel, [ store.swarmHost ])
let sw = swarm(hub, { wrtc: wrtc(), uuid })
sw.on('peer', function (peer, uuid) {
console.log('source: ', uuid)
// let key = Buffer.from(uuid, 'hex')
// db.authorize(key, () => {
let stream = db.replicate(/*{ download: true, upload: true }*/)
pump(peer, stream, peer, function (err, data) {
if (err) {
console.error('error: ', err)
} else {
console.log('success: ', data)
}
})
//
})
})
```
I didn't catch a single error in the dev tools, but the documents isn't propagated to the others instances of the hyperdb
```
target: 2a69e9bedad2bb4181011966a9003686272393ad...
source: 716a6528ee534dd4165153ad13dfb6bf1f5c2ce5...
success: undefined
source: 716a6528ee534dd4165153ad13dfb6bf1f5c2ce5...
success: undefined
```
whatever, I catch some errors in the terminal.
```
[27700:0402/224705.037:ERROR:adm_helpers.cc(73)] Failed to query stereo recording.
[27700:0402/224707.038:ERROR:peerconnection.cc(5801)] Called in wrong state: kHaveLocalOffer (INVALID_STATE)
[27700:0402/224707.039:ERROR:peerconnection.cc(2233)] Failed to set remote offer sdp: Called in wrong state: kHaveLocalOffer
[27700:0402/224719.415:ERROR:peerconnection.cc(5801)] Called in wrong state: kHaveLocalOffer (INVALID_STATE)
[27700:0402/224719.415:ERROR:peerconnection.cc(2233)] Failed to set remote offer sdp: Called in wrong state: kHaveLocalOffer
[27700:0402/224846.447:ERROR:peerconnection.cc(3011)] AddIceCandidate: ICE candidates can't be added without any remote session description.
```
Some OS and package infos.
```
Operating System - Windows_NT(10.0.17134) - win32/x64
NodeJs - 10.15.1
Global packages
NPM - 6.4.1
yarn - 1.13.0
@quasar/cli - 1.0.0-beta.4
cordova - 8.1.2 (cordova-lib@8.1.1)
Important local packages
quasar - 1.0.0-beta.15 -- High performance, Material Design 2, full front end stack with Vue.js -- build SPA, SSR, PWA, Hybrid Mobile Apps and Electron apps, all simultaneously using the same codebase
@quasar/app - 1.0.0-beta.15 -- Quasar Framework App CLI
@quasar/extras - 1.1.1 -- Quasar Framework fonts, icons and animations
vue - 2.6.10 -- Reactive, component-oriented view layer for modern web interfaces.
vue-router - 3.0.2 -- Official router for Vue.js 2
vuex - 3.1.0 -- state management for Vue.js
electron - 4.1.3 -- Build cross platform desktop apps with JavaScript, HTML, and CSS
electron-packager - Not installed
electron-builder - 20.39.0 -- A complete solution to package and build a ready for distribution Electron app for MacOS, Windows and Linux with “auto update” support out of the box
@babel/core - 7.3.4 -- Babel compiler core.
webpack - 4.29.6 -- Packs CommonJs/AMD modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.
webpack-dev-server - 3.2.1 -- Serves a webpack app. Updates the browser on changes.
workbox-webpack-plugin - 4.1.1 -- A plugin for your Webpack build process, helping you generate a manifest of local files that workbox-sw should precache.
register-service-worker - 1.6.2 -- Script for registering service worker, with hooks
```
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the db.replicate() call in the peer handler, then inspect how the signalhub and webrtc-swarm connection is passed to pump. Reproduce the example with the reported Electron and Windows versions, and determine whether documents propagate between the hyperdb instances without the WebRTC errors shown. Done means replication succeeds or the failing integration point is isolated with a reproducible test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- electron, javascript, node.js
- Domain
- databases, desktop, distributed-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100