@@ -530,14 +530,21 @@ export class GraphQLServer {
530530 parsed : parsedFromEnvelopes ,
531531 } ;
532532
533- // Deliver webhooks for update operation
533+ // Deliver webhooks for update operation.
534+ // Use the FULL post-write state, not input.payload —
535+ // input.payload is the partial diff the caller sent,
536+ // and receivers overwrite their local row with
537+ // whatever the webhook carries. Sending the diff
538+ // would make the receiver lose every untouched
539+ // field (e.g. a read-receipt update would wipe
540+ // participantIds on the receiver side).
534541 const requestingPlatform =
535542 context . tokenPayload ?. platform || null ;
536543 const webhookPayload = {
537544 id,
538545 w3id : context . eName ,
539546 evaultPublicKey : this . evaultPublicKey ,
540- data : input . payload ,
547+ data : result . mergedPayload ?? input . payload ,
541548 schemaId : input . ontology ,
542549 } ;
543550
@@ -1222,14 +1229,18 @@ export class GraphQLServer {
12221229 context . eName ,
12231230 ) ;
12241231
1225- // Deliver webhooks for update operation
1232+ // Deliver webhooks with the FULL post-write state.
1233+ // See the long comment on the new updateMetaEnvelope
1234+ // resolver above — sending input.payload (the
1235+ // partial diff) would make receivers clobber their
1236+ // own untouched fields.
12261237 const requestingPlatform =
12271238 context . tokenPayload ?. platform || null ;
12281239 const webhookPayload = {
12291240 id : id ,
12301241 w3id : context . eName ,
12311242 evaultPublicKey : this . evaultPublicKey ,
1232- data : input . payload ,
1243+ data : result . mergedPayload ?? input . payload ,
12331244 schemaId : input . ontology ,
12341245 } ;
12351246
0 commit comments