@fireproof/core 0.5.12 → 0.5.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fireproof/core",
3
- "version": "0.5.12",
3
+ "version": "0.5.13",
4
4
  "description": "Cloudless database for apps, the browser, and IPFS",
5
5
  "main": "dist/src/fireproof.js",
6
6
  "module": "dist/src/fireproof.mjs",
package/src/sync.js CHANGED
@@ -75,21 +75,22 @@ export class Sync {
75
75
  // console.log('not a car', data.toString())
76
76
  }
77
77
  if (reader) {
78
+ console.log('got car')
78
79
  this.status = 'parking car'
79
80
  const blz = new Set()
80
81
  for await (const block of reader.blocks()) {
81
82
  blz.add(block)
82
83
  }
83
84
  const roots = await reader.getRoots()
84
- // console.log(
85
- // 'got car',
86
- // roots.map(c => c.toString()),
87
- // this.database.clock.map(c => c.toString())
88
- // )
89
- // console.log(
90
- // 'got blocks',
91
- // [...blz].map(({ cid }) => cid.toString())
92
- // )
85
+ console.log(
86
+ 'got car',
87
+ roots.map(c => c.toString()),
88
+ this.database.clock.map(c => c.toString())
89
+ )
90
+ console.log(
91
+ 'got blocks',
92
+ [...blz].map(({ cid }) => cid.toString())
93
+ )
93
94
  // @ts-ignore
94
95
  reader.entries = reader.blocks
95
96
  await this.database.blocks.commit(
@@ -137,7 +138,7 @@ export class Sync {
137
138
  this.peer.send(JSON.stringify({ ok: true }))
138
139
  // this.pushBacklogResolve({ ok: true })
139
140
  } else {
140
- // console.log('do send', carBlock.bytes.length)
141
+ console.log('do send', carBlock.bytes.length)
141
142
  this.status = 'sending diff car'
142
143
  this.peer.send(carBlock.bytes)
143
144
  // this.pushBacklogResolve({ ok: true })