braid-text 0.2.109 → 0.2.110

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.
Files changed (2) hide show
  1. package/index.js +6 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -305,11 +305,13 @@ function create_braid_text() {
305
305
  var cv = remote_res.headers.get('current-version')
306
306
  await braid_text.put(a, {
307
307
  body: update.body,
308
- transfer_encoding: 'dt'
308
+ transfer_encoding: 'dt',
309
+ peer: options.peer
309
310
  })
310
311
  if (signal.aborted) return
311
312
  if (cv) extend_fork_point({ version: JSON.parse(`[${cv}]`), parents: resource.meta.fork_point || [] })
312
313
  } else {
314
+ if (options.peer) update.peer = options.peer
313
315
  await braid_text.put(a, update)
314
316
  if (signal.aborted) return
315
317
  if (update.version) extend_fork_point(update)
@@ -880,7 +882,9 @@ function create_braid_text() {
880
882
 
881
883
  // Notify non-simpleton clients with the dt-encoded update
882
884
  var dt_update = { body, encoding: 'dt' }
883
- await Promise.all([...resource.clients].map(client => client.my_subscribe(dt_update)))
885
+ await Promise.all([...resource.clients].
886
+ filter(client => !peer || client.peer !== peer).
887
+ map(client => client.my_subscribe(dt_update)))
884
888
 
885
889
  return { change_count: end_i - start_i + 1 }
886
890
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "braid-text",
3
- "version": "0.2.109",
3
+ "version": "0.2.110",
4
4
  "description": "Library for collaborative text over http using braid.",
5
5
  "author": "Braid Working Group",
6
6
  "repository": "braid-org/braid-text",