1
1
import type { RecordsReadReply } from '@tbd54566975/dwn-sdk-js' ;
2
- import { DwnInterfaceName , DwnMethodName } from '@tbd54566975/dwn-sdk-js' ;
3
2
4
3
import type { Readable as IsomorphicReadable } from 'readable-stream' ;
5
4
import { v4 as uuidv4 } from 'uuid' ;
@@ -23,26 +22,11 @@ export const handleDwnProcessMessage: JsonRpcHandler = async (
23
22
const requestId = dwnRequest . id ?? uuidv4 ( ) ;
24
23
25
24
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 ;
46
30
47
31
// RecordsRead messages return record data as a stream to for accommodate large amounts of data
48
32
let recordDataStream ;
0 commit comments