@mblaney/holster 1.0.20 → 1.0.21

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mblaney/holster",
3
- "version": "1.0.20",
3
+ "version": "1.0.21",
4
4
  "description": "Holster is a service that allows synchronising data between devices using Node, Deno, Bun or the browser.",
5
5
  "type": "module",
6
6
  "main": "index.js",
package/src/wire.js CHANGED
@@ -267,7 +267,10 @@ const Wire = opt => {
267
267
  if (Object.keys(update.now).length === 0) {
268
268
  // No updates to store, check deferred.
269
269
  if (Object.keys(update.defer).length !== 0) {
270
- setTimeout(() => put({put: update.defer}, send), update.wait)
270
+ setTimeout(
271
+ () => put({put: update.defer, "#": msg["#"]}, send),
272
+ update.wait,
273
+ )
271
274
  }
272
275
  return
273
276
  }
@@ -285,7 +288,10 @@ const Wire = opt => {
285
288
  })
286
289
 
287
290
  if (Object.keys(update.defer).length !== 0) {
288
- setTimeout(() => put({put: update.defer}, send), update.wait)
291
+ setTimeout(
292
+ () => put({put: update.defer, "#": msg["#"]}, send),
293
+ update.wait,
294
+ )
289
295
  }
290
296
  }
291
297
 
@@ -768,12 +774,11 @@ const Wire = opt => {
768
774
  }
769
775
  // Store filtered data if any
770
776
  if (Object.keys(filteredPut).length > 0) {
771
- // Create filtered message for Ham.mix
772
- const filteredMsg = {put: filteredPut}
777
+ // Create filtered message for Ham.mix with original message ID
778
+ const filteredMsg = {put: filteredPut, "#": msg["#"]}
773
779
  put(filteredMsg, send)
774
780
  }
775
781
  }
776
- send(m.data)
777
782
 
778
783
  const id = msg["@"]
779
784
  const cb = queue[id]