@dittolive/ditto 4.7.0-rc.3 → 4.7.0

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/README.md CHANGED
@@ -3,10 +3,10 @@
3
3
  _Ditto is a cross-platform SDK that allows mobile, web, and IoT apps to sync
4
4
  with and even without connectivity._
5
5
 
6
- Version: **4.7.0-rc.3**
6
+ Version: **4.7.0**
7
7
 
8
8
  For more information please visit [ditto.live](https://ditto.live), as well as the
9
- [API Reference](https://software.ditto.live/js/Ditto/4.7.0-rc.3/api-reference/) for this particular version.
9
+ [API Reference](https://software.ditto.live/js/Ditto/4.7.0/api-reference/) for this particular version.
10
10
 
11
11
  ---
12
12
 
package/node/ditto.cjs.js CHANGED
@@ -2218,7 +2218,7 @@ class AttachmentToken {
2218
2218
 
2219
2219
  // NOTE: this is patched up with the actual build version by Jake task
2220
2220
  // build:package and has to be a valid semantic version as defined here: https://semver.org.
2221
- const fullBuildVersionString = '4.7.0-rc.3';
2221
+ const fullBuildVersionString = '4.7.0';
2222
2222
 
2223
2223
  //
2224
2224
  // Copyright © 2021 DittoLive Incorporated. All rights reserved.
@@ -5282,10 +5282,12 @@ class ConnectionRequest {
5282
5282
  /**
5283
5283
  * Metadata associated with the remote peer.
5284
5284
  *
5285
- * This is an empty object if the remote peer has not set any metadata.
5285
+ * This is an empty object if the remote peer has not set any metadata, or
5286
+ * when this request is for a WebSocket connection (which does not currently
5287
+ * support peer metadata).
5286
5288
  *
5287
- * Set peer metadata for the local peer using {@link Presence.peerMetadata}
5288
- * or {@link Presence.peerMetadataJSONString}.
5289
+ * Set peer metadata for the local peer using {@link Presence.peerMetadata} or
5290
+ * {@link Presence.peerMetadataJSONString}.
5289
5291
  *
5290
5292
  * This is a convenience property that wraps
5291
5293
  * {@link peerMetadataJSONString | `peerMetadataJSONString()`}.
@@ -5297,7 +5299,8 @@ class ConnectionRequest {
5297
5299
  * JSON-encoded metadata associated with the remote peer.
5298
5300
  *
5299
5301
  * This is a JSON string representing an empty dictionary if the remote peer
5300
- * has not set any metadata.
5302
+ * has not set any metadata or when this request is for a WebSocket
5303
+ * connection.
5301
5304
  *
5302
5305
  * Set peer metadata for the local peer using {@link Presence.peerMetadata} or
5303
5306
  * {@link Presence.peerMetadataJSONString}.
@@ -8254,6 +8257,8 @@ class Presence {
8254
8257
  * and when evaluating connection requests using
8255
8258
  * {@link connectionRequestHandler | connectionRequestHandler()}.
8256
8259
  *
8260
+ * This is not made available to peers only connected via WebSocket.
8261
+ *
8257
8262
  * Uses UTF-8 encoding.
8258
8263
  *
8259
8264
  * @see {@link peerMetadata | peerMetadata()} for a convenience property that
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dittolive/ditto",
3
- "version": "4.7.0-rc.3",
3
+ "version": "4.7.0",
4
4
  "description": "Ditto is a cross-platform embeddable NoSQL database that can sync with or without an internet connection.",
5
5
  "homepage": "https://ditto.live",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -150,7 +150,7 @@ repositories {
150
150
 
151
151
  // This can be moved to gradle.properties (minus the quotes) with no code changes
152
152
  // here since `version` is a default project property.
153
- version = "4.7.0-rc.3"
153
+ version = "4.7.0"
154
154
 
155
155
  dependencies {
156
156
  // For < 0.71, this will be from the local maven repo
@@ -9,7 +9,7 @@ namespace sharedjsi
9
9
  {
10
10
  Function dittoffi_connection_request_peer_key_string(Runtime &runtime);
11
11
  Function dittoffi_connection_request_peer_metadata_json(Runtime &runtime);
12
- Function dittoffi_connection_request_identity_service_json(Runtime &runtime);
12
+ Function dittoffi_connection_request_identity_service_metadata_json(Runtime &runtime);
13
13
  Function dittoffi_connection_request_authorize(Runtime &runtime);
14
14
  Function dittoffi_connection_request_connection_type(Runtime &runtime);
15
15
  Function dittoffi_connection_request_free(Runtime &runtime);
@@ -40,7 +40,7 @@ Function dittoffi_connection_request_peer_metadata_json(Runtime &runtime)
40
40
  });
41
41
  }
42
42
 
43
- Function dittoffi_connection_request_identity_service_json(Runtime &runtime)
43
+ Function dittoffi_connection_request_identity_service_metadata_json(Runtime &runtime)
44
44
  {
45
45
  return Function::createFromHostFunction(runtime,
46
46
  PropNameID::forAscii(runtime,
@@ -148,7 +148,7 @@ namespace sharedjsi
148
148
  // Connection Request
149
149
  REGISTER_JS_FUNCTION(dittoffi_connection_request_peer_key_string);
150
150
  REGISTER_JS_FUNCTION(dittoffi_connection_request_peer_metadata_json);
151
- REGISTER_JS_FUNCTION(dittoffi_connection_request_identity_service_json);
151
+ REGISTER_JS_FUNCTION(dittoffi_connection_request_identity_service_metadata_json);
152
152
  REGISTER_JS_FUNCTION(dittoffi_connection_request_authorize);
153
153
  REGISTER_JS_FUNCTION(dittoffi_connection_request_free);
154
154
  REGISTER_JS_FUNCTION(dittoffi_connection_request_connection_type);
@@ -52,10 +52,12 @@ export class ConnectionRequest {
52
52
  /**
53
53
  * Metadata associated with the remote peer.
54
54
  *
55
- * This is an empty object if the remote peer has not set any metadata.
55
+ * This is an empty object if the remote peer has not set any metadata, or
56
+ * when this request is for a WebSocket connection (which does not currently
57
+ * support peer metadata).
56
58
  *
57
- * Set peer metadata for the local peer using {@link Presence.peerMetadata}
58
- * or {@link Presence.peerMetadataJSONString}.
59
+ * Set peer metadata for the local peer using {@link Presence.peerMetadata} or
60
+ * {@link Presence.peerMetadataJSONString}.
59
61
  *
60
62
  * This is a convenience property that wraps
61
63
  * {@link peerMetadataJSONString | `peerMetadataJSONString()`}.
@@ -68,7 +70,8 @@ export class ConnectionRequest {
68
70
  * JSON-encoded metadata associated with the remote peer.
69
71
  *
70
72
  * This is a JSON string representing an empty dictionary if the remote peer
71
- * has not set any metadata.
73
+ * has not set any metadata or when this request is for a WebSocket
74
+ * connection.
72
75
  *
73
76
  * Set peer metadata for the local peer using {@link Presence.peerMetadata} or
74
77
  * {@link Presence.peerMetadataJSONString}.
@@ -119,6 +119,9 @@ export type Peer = {
119
119
  * Use `ditto.presence.setPeerMetadata()` or
120
120
  * `ditto.presence.setPeerMetadataJSONData()` to set this value.
121
121
  *
122
+ * This will be empty when a peer is only connected via a WebSocket
123
+ * connection.
124
+ *
122
125
  * @see {@link Presence.peerMetadata | `ditto.presence.peerMetadata`} for
123
126
  * details on usage of metadata.
124
127
  */
@@ -284,6 +287,8 @@ export class Presence {
284
287
  * and when evaluating connection requests using
285
288
  * {@link connectionRequestHandler | connectionRequestHandler()}.
286
289
  *
290
+ * This is not made available to peers only connected via WebSocket.
291
+ *
287
292
  * Uses UTF-8 encoding.
288
293
  *
289
294
  * @see {@link peerMetadata | peerMetadata()} for a convenience property that
@@ -375,11 +380,6 @@ export class Presence {
375
380
  const observerToken = this.observerManager.addObserver(didChangeHandler)
376
381
  const observer = new Observer(this.observerManager, observerToken, { stopsWhenFinalized: true })
377
382
 
378
- // REFACTOR: make the initial callback call async, too (othewise we'd be
379
- // mixing sync with async, which is a bit problematic in general but might
380
- // be OK with single-threaded JS). This is a bit tricky, simply
381
- // setTimeout(..., 0) here could lead us to a situation where the initial
382
- // call would be sent AFTER the regular notification.
383
383
  didChangeHandler(this.graph)
384
384
 
385
385
  return observer
package/types/ditto.d.ts CHANGED
@@ -2853,10 +2853,12 @@ declare class ConnectionRequest {
2853
2853
  /**
2854
2854
  * Metadata associated with the remote peer.
2855
2855
  *
2856
- * This is an empty object if the remote peer has not set any metadata.
2856
+ * This is an empty object if the remote peer has not set any metadata, or
2857
+ * when this request is for a WebSocket connection (which does not currently
2858
+ * support peer metadata).
2857
2859
  *
2858
- * Set peer metadata for the local peer using {@link Presence.peerMetadata}
2859
- * or {@link Presence.peerMetadataJSONString}.
2860
+ * Set peer metadata for the local peer using {@link Presence.peerMetadata} or
2861
+ * {@link Presence.peerMetadataJSONString}.
2860
2862
  *
2861
2863
  * This is a convenience property that wraps
2862
2864
  * {@link peerMetadataJSONString | `peerMetadataJSONString()`}.
@@ -2866,7 +2868,8 @@ declare class ConnectionRequest {
2866
2868
  * JSON-encoded metadata associated with the remote peer.
2867
2869
  *
2868
2870
  * This is a JSON string representing an empty dictionary if the remote peer
2869
- * has not set any metadata.
2871
+ * has not set any metadata or when this request is for a WebSocket
2872
+ * connection.
2870
2873
  *
2871
2874
  * Set peer metadata for the local peer using {@link Presence.peerMetadata} or
2872
2875
  * {@link Presence.peerMetadataJSONString}.
@@ -2986,6 +2989,9 @@ type Peer = {
2986
2989
  * Use `ditto.presence.setPeerMetadata()` or
2987
2990
  * `ditto.presence.setPeerMetadataJSONData()` to set this value.
2988
2991
  *
2992
+ * This will be empty when a peer is only connected via a WebSocket
2993
+ * connection.
2994
+ *
2989
2995
  * @see {@link Presence.peerMetadata | `ditto.presence.peerMetadata`} for
2990
2996
  * details on usage of metadata.
2991
2997
  */
@@ -3091,6 +3097,8 @@ declare class Presence {
3091
3097
  * and when evaluating connection requests using
3092
3098
  * {@link connectionRequestHandler | connectionRequestHandler()}.
3093
3099
  *
3100
+ * This is not made available to peers only connected via WebSocket.
3101
+ *
3094
3102
  * Uses UTF-8 encoding.
3095
3103
  *
3096
3104
  * @see {@link peerMetadata | peerMetadata()} for a convenience property that