@automerge/automerge-repo-network-websocket 0.1.3-alpha.0 → 0.1.4-alpha.1

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.
@@ -75,7 +75,7 @@ export class BrowserWebSocketClientAdapter extends WebSocketNetworkAdapter {
75
75
  senderId: this.peerId,
76
76
  targetId,
77
77
  channelId,
78
- type: "message",
78
+ type: "sync",
79
79
  message,
80
80
  broadcast,
81
81
  };
@@ -1 +1 @@
1
- {"version":3,"file":"NodeWSServerAdapter.d.ts","sourceRoot":"","sources":["../src/NodeWSServerAdapter.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,KAAK,eAAe,EAAE,MAAM,eAAe,CAAA;AAK/D,OAAO,EACL,SAAS,EAET,cAAc,EACd,MAAM,EACP,MAAM,2BAA2B,CAAA;AAElC,qBAAa,mBAAoB,SAAQ,cAAc;IACrD,MAAM,EAAE,eAAe,CAAA;IACvB,OAAO,EAAE;QAAE,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,CAAK;gBAEjC,MAAM,EAAE,eAAe;IAKnC,OAAO,CAAC,MAAM,EAAE,MAAM;IAmBtB,IAAI,CAAC,KAAK,EAAE,SAAS;IAIrB,KAAK,CAAC,KAAK,EAAE,SAAS;IAItB,WAAW,CACT,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,UAAU,EACnB,SAAS,EAAE,OAAO;IAsCpB,cAAc,CAAC,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS;CAmDtD"}
1
+ {"version":3,"file":"NodeWSServerAdapter.d.ts","sourceRoot":"","sources":["../src/NodeWSServerAdapter.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,KAAK,eAAe,EAAE,MAAM,eAAe,CAAA;AAK/D,OAAO,EACL,SAAS,EAET,cAAc,EACd,MAAM,EACP,MAAM,2BAA2B,CAAA;AAElC,qBAAa,mBAAoB,SAAQ,cAAc;IACrD,MAAM,EAAE,eAAe,CAAA;IACvB,OAAO,EAAE;QAAE,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,CAAK;gBAEjC,MAAM,EAAE,eAAe;IAKnC,OAAO,CAAC,MAAM,EAAE,MAAM;IAmBtB,IAAI,CAAC,KAAK,EAAE,SAAS;IAIrB,KAAK,CAAC,KAAK,EAAE,SAAS;IAItB,WAAW,CACT,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,UAAU,EACnB,SAAS,EAAE,OAAO;IAsCpB,cAAc,CAAC,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS;CAwDtD"}
@@ -80,7 +80,11 @@ export class NodeWSServerAdapter extends NetworkAdapter {
80
80
  // TODO: confirm this
81
81
  // ?
82
82
  break;
83
+ // We accept both "message" and "sync" because a previous version of this
84
+ // codebase sent sync messages in the BrowserWebSocketClientAdapter as
85
+ // type "message" and we want to stay backwards compatible
83
86
  case "message":
87
+ case "sync":
84
88
  this.emit("message", {
85
89
  senderId,
86
90
  targetId,
@@ -90,7 +94,7 @@ export class NodeWSServerAdapter extends NetworkAdapter {
90
94
  });
91
95
  break;
92
96
  default:
93
- // log("unrecognized message type")
97
+ log(`unrecognized message type ${type}`);
94
98
  break;
95
99
  }
96
100
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automerge/automerge-repo-network-websocket",
3
- "version": "0.1.3-alpha.0",
3
+ "version": "0.1.4-alpha.1",
4
4
  "description": "isomorphic node/browser Websocket network adapter for Automerge Repo",
5
5
  "repository": "https://github.com/automerge/automerge-repo",
6
6
  "author": "Peter van Hardenberg <pvh@pvh.ca>",
@@ -14,7 +14,7 @@
14
14
  "test": "mocha --no-warnings --experimental-specifier-resolution=node --exit"
15
15
  },
16
16
  "dependencies": {
17
- "@automerge/automerge-repo": "^0.1.3-alpha.0",
17
+ "@automerge/automerge-repo": "^0.1.4-alpha.1",
18
18
  "cbor-x": "^1.3.0",
19
19
  "eventemitter3": "^4.0.7",
20
20
  "isomorphic-ws": "^5.0.0"
@@ -30,5 +30,5 @@
30
30
  "publishConfig": {
31
31
  "access": "public"
32
32
  },
33
- "gitHead": "5b1959b8a7c1834e5dbbddbce9681f6208024377"
33
+ "gitHead": "10312fcdf52f56a4834236a45f7814886cd3cc56"
34
34
  }
@@ -110,7 +110,7 @@ export class BrowserWebSocketClientAdapter extends WebSocketNetworkAdapter {
110
110
  senderId: this.peerId,
111
111
  targetId,
112
112
  channelId,
113
- type: "message",
113
+ type: "sync",
114
114
  message,
115
115
  broadcast,
116
116
  }
@@ -126,7 +126,12 @@ export class NodeWSServerAdapter extends NetworkAdapter {
126
126
  // TODO: confirm this
127
127
  // ?
128
128
  break
129
+
130
+ // We accept both "message" and "sync" because a previous version of this
131
+ // codebase sent sync messages in the BrowserWebSocketClientAdapter as
132
+ // type "message" and we want to stay backwards compatible
129
133
  case "message":
134
+ case "sync":
130
135
  this.emit("message", {
131
136
  senderId,
132
137
  targetId,
@@ -136,7 +141,7 @@ export class NodeWSServerAdapter extends NetworkAdapter {
136
141
  })
137
142
  break
138
143
  default:
139
- // log("unrecognized message type")
144
+ log(`unrecognized message type ${type}`)
140
145
  break
141
146
  }
142
147
  }