Skip to content

Commit a55711f

Browse files
authored
Updated dwn-sdk-js and dwn-sql-store dependencies + v0.1.8 (#95)
Updated dependencies + v0.1.8
1 parent 7a178b5 commit a55711f

File tree

3 files changed

+20
-36
lines changed

3 files changed

+20
-36
lines changed

package-lock.json

+12-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@web5/dwn-server",
33
"type": "module",
4-
"version": "0.1.7",
4+
"version": "0.1.8",
55
"files": [
66
"dist",
77
"src"
@@ -26,8 +26,8 @@
2626
"url": "https://github.com/TBD54566975/dwn-server/issues"
2727
},
2828
"dependencies": {
29-
"@tbd54566975/dwn-sdk-js": "0.2.8",
30-
"@tbd54566975/dwn-sql-store": "0.2.4",
29+
"@tbd54566975/dwn-sdk-js": "0.2.9",
30+
"@tbd54566975/dwn-sql-store": "0.2.5",
3131
"better-sqlite3": "^8.5.0",
3232
"bytes": "3.1.2",
3333
"cors": "2.8.5",

src/json-rpc-handlers/dwn/process-message.ts

+5-21
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import type { RecordsReadReply } from '@tbd54566975/dwn-sdk-js';
2-
import { DwnInterfaceName, DwnMethodName } from '@tbd54566975/dwn-sdk-js';
32

43
import type { Readable as IsomorphicReadable } from 'readable-stream';
54
import { v4 as uuidv4 } from 'uuid';
@@ -23,26 +22,11 @@ export const handleDwnProcessMessage: JsonRpcHandler = async (
2322
const requestId = dwnRequest.id ?? uuidv4();
2423

2524
try {
26-
let reply;
27-
const messageType =
28-
message?.descriptor?.interface + message?.descriptor?.method;
29-
30-
// When a record is deleted via `RecordsDelete`, the initial RecordsWrite is kept as a tombstone _in addition_
31-
// to the RecordsDelete message. the data associated to that initial RecordsWrite is deleted. If a record was written
32-
// _and_ deleted before it ever got to dwn-server, we end up in a situation where we still need to process the tombstone
33-
// so that we can process the RecordsDelete.
34-
if (
35-
messageType === DwnInterfaceName.Records + DwnMethodName.Write &&
36-
!dataStream
37-
) {
38-
reply = await dwn.synchronizePrunedInitialRecordsWrite(target, message);
39-
} else {
40-
reply = (await dwn.processMessage(
41-
target,
42-
message,
43-
dataStream as IsomorphicReadable,
44-
)) as RecordsReadReply;
45-
}
25+
const reply = (await dwn.processMessage(
26+
target,
27+
message,
28+
dataStream as IsomorphicReadable,
29+
)) as RecordsReadReply;
4630

4731
// RecordsRead messages return record data as a stream to for accommodate large amounts of data
4832
let recordDataStream;

0 commit comments

Comments
 (0)