diff --git a/package-lock.json b/package-lock.json index bad9c7a..d135190 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,15 +1,15 @@ { "name": "@web5/dwn-server", - "version": "0.1.7", + "version": "0.1.8", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@web5/dwn-server", - "version": "0.1.7", + "version": "0.1.8", "dependencies": { - "@tbd54566975/dwn-sdk-js": "0.2.8", - "@tbd54566975/dwn-sql-store": "0.2.4", + "@tbd54566975/dwn-sdk-js": "0.2.9", + "@tbd54566975/dwn-sql-store": "0.2.5", "better-sqlite3": "^8.5.0", "bytes": "3.1.2", "cors": "2.8.5", @@ -828,9 +828,9 @@ "dev": true }, "node_modules/@tbd54566975/dwn-sdk-js": { - "version": "0.2.8", - "resolved": "https://registry.npmjs.org/@tbd54566975/dwn-sdk-js/-/dwn-sdk-js-0.2.8.tgz", - "integrity": "sha512-oiKk+ekAQO94bUkt6yk+xkDY8uCGmNC+rKaYQLhAoTrhYrczeRSuDT04F5/vPBT5K6NfAoRcQsIyBmvgRCUvgA==", + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/@tbd54566975/dwn-sdk-js/-/dwn-sdk-js-0.2.9.tgz", + "integrity": "sha512-p9wv0GrNq0BgUMvlS54osLKAZE/WhTV89Oh0nvGUk9NH5iwvswlbG4aygw4vDqdVo7XruzfGienW0X/eNWZL0g==", "dependencies": { "@ipld/dag-cbor": "9.0.3", "@js-temporal/polyfill": "0.4.4", @@ -841,7 +841,6 @@ "blockstore-core": "4.2.0", "cross-fetch": "4.0.0", "eciesjs": "0.4.5", - "flat": "5.0.2", "interface-blockstore": "5.2.3", "interface-store": "5.1.2", "ipfs-unixfs-exporter": "13.1.5", @@ -870,12 +869,12 @@ } }, "node_modules/@tbd54566975/dwn-sql-store": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/@tbd54566975/dwn-sql-store/-/dwn-sql-store-0.2.4.tgz", - "integrity": "sha512-LwSpQMcKtNEAj8ffn/UGrYwiENjN4S7rIDX5FDJ4+qjnMbF7I051i1bpw3INKnrtnVWAuynD5033EHSKLml0Zw==", + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/@tbd54566975/dwn-sql-store/-/dwn-sql-store-0.2.5.tgz", + "integrity": "sha512-WA0dqVhidBg1EKMyYGMXo1HDoaPDKRjycKwpBNj0Hgt9zUwRG1PvqP1m5xFzTI+wryJEVvew/KkRICkz67sLLQ==", "dependencies": { "@ipld/dag-cbor": "^9.0.5", - "@tbd54566975/dwn-sdk-js": "0.2.8", + "@tbd54566975/dwn-sdk-js": "0.2.9", "kysely": "0.26.3", "multiformats": "12.0.1", "readable-stream": "4.4.2" @@ -4254,6 +4253,7 @@ "version": "5.0.2", "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "dev": true, "bin": { "flat": "cli.js" } diff --git a/package.json b/package.json index 462e847..db8d108 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@web5/dwn-server", "type": "module", - "version": "0.1.7", + "version": "0.1.8", "files": [ "dist", "src" @@ -26,8 +26,8 @@ "url": "https://github.com/TBD54566975/dwn-server/issues" }, "dependencies": { - "@tbd54566975/dwn-sdk-js": "0.2.8", - "@tbd54566975/dwn-sql-store": "0.2.4", + "@tbd54566975/dwn-sdk-js": "0.2.9", + "@tbd54566975/dwn-sql-store": "0.2.5", "better-sqlite3": "^8.5.0", "bytes": "3.1.2", "cors": "2.8.5", diff --git a/src/json-rpc-handlers/dwn/process-message.ts b/src/json-rpc-handlers/dwn/process-message.ts index cfe705c..30597e3 100644 --- a/src/json-rpc-handlers/dwn/process-message.ts +++ b/src/json-rpc-handlers/dwn/process-message.ts @@ -1,5 +1,4 @@ import type { RecordsReadReply } from '@tbd54566975/dwn-sdk-js'; -import { DwnInterfaceName, DwnMethodName } from '@tbd54566975/dwn-sdk-js'; import type { Readable as IsomorphicReadable } from 'readable-stream'; import { v4 as uuidv4 } from 'uuid'; @@ -23,26 +22,11 @@ export const handleDwnProcessMessage: JsonRpcHandler = async ( const requestId = dwnRequest.id ?? uuidv4(); try { - let reply; - const messageType = - message?.descriptor?.interface + message?.descriptor?.method; - - // When a record is deleted via `RecordsDelete`, the initial RecordsWrite is kept as a tombstone _in addition_ - // to the RecordsDelete message. the data associated to that initial RecordsWrite is deleted. If a record was written - // _and_ deleted before it ever got to dwn-server, we end up in a situation where we still need to process the tombstone - // so that we can process the RecordsDelete. - if ( - messageType === DwnInterfaceName.Records + DwnMethodName.Write && - !dataStream - ) { - reply = await dwn.synchronizePrunedInitialRecordsWrite(target, message); - } else { - reply = (await dwn.processMessage( - target, - message, - dataStream as IsomorphicReadable, - )) as RecordsReadReply; - } + const reply = (await dwn.processMessage( + target, + message, + dataStream as IsomorphicReadable, + )) as RecordsReadReply; // RecordsRead messages return record data as a stream to for accommodate large amounts of data let recordDataStream;