@live-change/db-server 0.8.20 → 0.8.22
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/lib/Server.js +6 -6
- package/package.json +13 -13
- package/ai/metadata.json.bak +0 -1048
- package/vole-apps.db.bak/metadata.json.bak +0 -2786
package/lib/Server.js
CHANGED
|
@@ -283,14 +283,14 @@ class Server {
|
|
|
283
283
|
}
|
|
284
284
|
async checkInfoIntegrity() {
|
|
285
285
|
for(const dbName in this.metadata.databases) {
|
|
286
|
-
if(dbName
|
|
286
|
+
if(dbName !== 'system') {
|
|
287
287
|
const metadata = this.metadata.databases[dbName]
|
|
288
288
|
const indexesTable = this.databases.get('system').table(dbName + '_indexes')
|
|
289
289
|
const indexesInfo = await indexesTable.rangeGet({})
|
|
290
290
|
const infoByName = new Map()
|
|
291
291
|
for(const indexInfo of indexesInfo) {
|
|
292
292
|
const indexMeta = metadata.indexes[indexInfo.name]
|
|
293
|
-
if(!indexMeta || (indexMeta.uid
|
|
293
|
+
if(!indexMeta || (indexMeta.uid !== indexInfo.id)) {
|
|
294
294
|
console.error("CORRUPTED INDEX INFO", indexInfo.name, indexInfo.id)
|
|
295
295
|
console.log("DELETING CORRUPTED INFO")
|
|
296
296
|
await indexesTable.delete(indexInfo.id)
|
|
@@ -370,7 +370,7 @@ class Server {
|
|
|
370
370
|
})
|
|
371
371
|
wsServer.on("request",(request) => {
|
|
372
372
|
debug("WS URI", request.httpRequest.url, "FROM", request.remoteAddress)
|
|
373
|
-
if(request.httpRequest.url
|
|
373
|
+
if(request.httpRequest.url !== "/api/ws") return request.reject()
|
|
374
374
|
let serverConnection = new ReactiveDaoWebsocketServer(request)
|
|
375
375
|
this.apiServer.handleConnection(serverConnection)
|
|
376
376
|
})
|
|
@@ -412,18 +412,18 @@ class Server {
|
|
|
412
412
|
|
|
413
413
|
const databaseName = pathParts[0]
|
|
414
414
|
const objectDir = pathParts[1]
|
|
415
|
-
if(objectDir
|
|
415
|
+
if(objectDir === 'query.js') {
|
|
416
416
|
console.error("error in query to database", databaseName)
|
|
417
417
|
return
|
|
418
418
|
}
|
|
419
419
|
const database = this.databases.get(databaseName)
|
|
420
|
-
if(objectDir
|
|
420
|
+
if(objectDir !== 'indexes') {
|
|
421
421
|
console.error(`unknown object dir ${objectDir}, something is wrong, exiting...`)
|
|
422
422
|
process.exit(1)
|
|
423
423
|
}
|
|
424
424
|
const indexName = pathParts[2]
|
|
425
425
|
if(!database) {
|
|
426
|
-
if(this.initializingDatabase.name
|
|
426
|
+
if(this.initializingDatabase.name !== databaseName) {
|
|
427
427
|
console.error('error in non existing database?!', databaseName)
|
|
428
428
|
process.exit(1)
|
|
429
429
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@live-change/db-server",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.22",
|
|
4
4
|
"description": "Database with observable data for live queries",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -29,17 +29,17 @@
|
|
|
29
29
|
"tape": "^5.7.4"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@live-change/dao": "^0.8.
|
|
33
|
-
"@live-change/dao-message": "^0.8.
|
|
34
|
-
"@live-change/dao-sockjs": "^0.8.
|
|
35
|
-
"@live-change/dao-websocket": "^0.8.
|
|
36
|
-
"@live-change/db": "^0.8.
|
|
37
|
-
"@live-change/db-admin": "^0.8.
|
|
38
|
-
"@live-change/db-client": "^0.8.
|
|
39
|
-
"@live-change/db-store-level": "^0.8.
|
|
40
|
-
"@live-change/db-store-lmdb": "^0.8.
|
|
41
|
-
"@live-change/db-store-observable-db": "^0.8.
|
|
42
|
-
"@live-change/db-store-rbtree": "^0.8.
|
|
32
|
+
"@live-change/dao": "^0.8.22",
|
|
33
|
+
"@live-change/dao-message": "^0.8.22",
|
|
34
|
+
"@live-change/dao-sockjs": "^0.8.22",
|
|
35
|
+
"@live-change/dao-websocket": "^0.8.22",
|
|
36
|
+
"@live-change/db": "^0.8.22",
|
|
37
|
+
"@live-change/db-admin": "^0.8.22",
|
|
38
|
+
"@live-change/db-client": "^0.8.22",
|
|
39
|
+
"@live-change/db-store-level": "^0.8.22",
|
|
40
|
+
"@live-change/db-store-lmdb": "^0.8.22",
|
|
41
|
+
"@live-change/db-store-observable-db": "^0.8.22",
|
|
42
|
+
"@live-change/db-store-rbtree": "^0.8.22",
|
|
43
43
|
"@live-change/sockjs": "0.4.1",
|
|
44
44
|
"express": "^4.18.2",
|
|
45
45
|
"line-reader": "^0.4.0",
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"websocket": "^1.0.34",
|
|
50
50
|
"yargs": "^17.7.2"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "70a56ac3dc54167a2d32ce47a00150e7a94bd04d"
|
|
53
53
|
}
|