statebus 7.0.16 → 7.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/client-library.js CHANGED
@@ -107,12 +107,15 @@
107
107
  patches: the_put.patches
108
108
  }
109
109
  ).then(function (res) {
110
- if (res.status !== 200)
110
+ if (res.status === 200) {
111
+ console.log('PUT succeeded!')
112
+ puts.delete(id)
113
+ }
114
+ else
111
115
  console.error(
112
116
  'Server gave error on PUT:', e,
113
117
  'for', {body: the_put.body, patches: the_put.patches}
114
118
  )
115
- puts.delete(id)
116
119
  }).catch(function (e) {
117
120
  console.error(e, 'Error on PUT, waiting...', the_put.url)
118
121
  the_put.status = 'waiting'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "statebus",
3
- "version": "7.0.16",
3
+ "version": "7.0.17",
4
4
  "description": "Synchronize state.",
5
5
  "main": "statebus.js",
6
6
  "scripts": {
package/server-library.js CHANGED
@@ -236,8 +236,7 @@ function import_server (bus, make_statebus, options)
236
236
  var key = req.url.substr(1)
237
237
  cbus.get_once(key, (obj) => {
238
238
  cbus.set(key, {patch: statebus_patches})
239
- res.statusCode = 200
240
- res.end
239
+ res.sendStatus(200)
241
240
  console.log('We just processed a patch!')
242
241
  })
243
242
  })