@firebase/database 0.13.0-20220505222723 → 0.13.0-canary.094da9eed

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/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Unreleased
2
2
 
3
- ## 0.13.0-20220505222723
3
+ ## 0.13.0
4
4
 
5
5
  ### Minor Changes
6
6
 
@@ -8,9 +8,11 @@
8
8
 
9
9
  ### Patch Changes
10
10
 
11
+ - [`874cdbbcc`](https://github.com/firebase/firebase-js-sdk/commit/874cdbbccbc2bf8f4ee18abe220e87dc52e6a8db) [#6232](https://github.com/firebase/firebase-js-sdk/pull/6232) - Added GMPID to websocket connection.
12
+
11
13
  - Updated dependencies [[`9c5c9c36d`](https://github.com/firebase/firebase-js-sdk/commit/9c5c9c36da80b98b73cfd60ef2e2965087e9f801)]:
12
- - @firebase/util@1.6.0-20220505222723
13
- - @firebase/component@0.5.14-20220505222723
14
+ - @firebase/util@1.6.0
15
+ - @firebase/component@0.5.14
14
16
 
15
17
  ## 0.12.8
16
18
 
@@ -4,7 +4,7 @@ import { stringify, jsonEval, contains, assert, isNodeSdk, base64, stringToByteA
4
4
  import { Logger, LogLevel } from '@firebase/logger';
5
5
 
6
6
  const name = "@firebase/database";
7
- const version = "0.13.0-20220505222723";
7
+ const version = "0.13.0-canary.094da9eed";
8
8
 
9
9
  /**
10
10
  * @license
@@ -1803,7 +1803,7 @@ class WebSocketConnection {
1803
1803
  this.bytesReceived = 0;
1804
1804
  this.log_ = logWrapper(this.connId);
1805
1805
  this.stats_ = statsManagerGetCollection(repoInfo);
1806
- this.connURL = WebSocketConnection.connectionURL_(repoInfo, transportSessionId, lastSessionId, appCheckToken);
1806
+ this.connURL = WebSocketConnection.connectionURL_(repoInfo, transportSessionId, lastSessionId, appCheckToken, applicationId);
1807
1807
  this.nodeAdmin = repoInfo.nodeAdmin;
1808
1808
  }
1809
1809
  /**
@@ -1813,7 +1813,7 @@ class WebSocketConnection {
1813
1813
  * @param lastSessionId - Optional lastSessionId if there was a previous connection
1814
1814
  * @returns connection url
1815
1815
  */
1816
- static connectionURL_(repoInfo, transportSessionId, lastSessionId, appCheckToken) {
1816
+ static connectionURL_(repoInfo, transportSessionId, lastSessionId, appCheckToken, applicationId) {
1817
1817
  const urlParams = {};
1818
1818
  urlParams[VERSION_PARAM] = PROTOCOL_VERSION;
1819
1819
  if (!isNodeSdk() &&
@@ -1831,6 +1831,9 @@ class WebSocketConnection {
1831
1831
  if (appCheckToken) {
1832
1832
  urlParams[APP_CHECK_TOKEN_PARAM] = appCheckToken;
1833
1833
  }
1834
+ if (applicationId) {
1835
+ urlParams[APPLICATION_ID_PARAM] = applicationId;
1836
+ }
1834
1837
  return repoInfoConnectionURL(repoInfo, WEBSOCKET, urlParams);
1835
1838
  }
1836
1839
  /**
@@ -1845,6 +1848,7 @@ class WebSocketConnection {
1845
1848
  // Assume failure until proven otherwise.
1846
1849
  PersistentStorage.set('previous_websocket_failure', true);
1847
1850
  try {
1851
+ let options;
1848
1852
  if (isNodeSdk()) {
1849
1853
  const device = this.nodeAdmin ? 'AdminNode' : 'Node';
1850
1854
  // UA Format: Firebase/<wire_protocol>/<sdk_version>/<platform>/<device>
@@ -1873,17 +1877,8 @@ class WebSocketConnection {
1873
1877
  if (proxy) {
1874
1878
  options['proxy'] = { origin: proxy };
1875
1879
  }
1876
- this.mySock = new WebSocketImpl(this.connURL, [], options);
1877
- }
1878
- else {
1879
- const options = {
1880
- headers: {
1881
- 'X-Firebase-GMPID': this.applicationId || '',
1882
- 'X-Firebase-AppCheck': this.appCheckToken || ''
1883
- }
1884
- };
1885
- this.mySock = new WebSocketImpl(this.connURL, [], options);
1886
1880
  }
1881
+ this.mySock = new WebSocketImpl(this.connURL, [], options);
1887
1882
  }
1888
1883
  catch (e) {
1889
1884
  this.log_('Error instantiating WebSocket.');