From ad9e288519258a74612e4bf3992272babf1e75f9 Mon Sep 17 00:00:00 2001 From: Gilles Coremans Date: Wed, 11 Aug 2021 17:00:08 +0200 Subject: [PATCH 1/2] Add support for indices indicating ordering of deltas --- app.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app.js b/app.js index 97c710a..7eac7d1 100644 --- a/app.js +++ b/app.js @@ -39,7 +39,7 @@ app.post( '/', function( req, res ) { } ); // inform watchers - informWatchers( changeSets, res, muCallIdTrail ); + informWatchers( changeSets, res, muCallIdTrail ); // push relevant data to interested actors res.status(204).send(); @@ -118,7 +118,8 @@ function formatChangesetBody( changeSets, options ) { changeSets.map( (change) => { return { inserts: change.insert, - deletes: change.delete + deletes: change.delete, + index: change.index }; } ) ); } From 2f6692437badbc45c1f539c1d4b325c3ddb5458a Mon Sep 17 00:00:00 2001 From: Gilles Coremans Date: Thu, 12 Aug 2021 15:00:47 +0200 Subject: [PATCH 2/2] Pretty print request logging --- app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.js b/app.js index 7eac7d1..f690ffa 100644 --- a/app.js +++ b/app.js @@ -24,7 +24,7 @@ app.get( '/', function( req, res ) { app.post( '/', function( req, res ) { if( process.env["LOG_REQUESTS"] ) { console.log("Logging request body"); - console.log(req.body); + console.log(JSON.stringify(req.body, null, 2)); // Pretty print } const changeSets = req.body.changeSets;