@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.
@@ -944,7 +944,7 @@ class WebSocketConnection {
944
944
  this.bytesReceived = 0;
945
945
  this.log_ = logWrapper(this.connId);
946
946
  this.stats_ = statsManagerGetCollection(repoInfo);
947
- this.connURL = WebSocketConnection.connectionURL_(repoInfo, transportSessionId, lastSessionId, appCheckToken);
947
+ this.connURL = WebSocketConnection.connectionURL_(repoInfo, transportSessionId, lastSessionId, appCheckToken, applicationId);
948
948
  this.nodeAdmin = repoInfo.nodeAdmin;
949
949
  }
950
950
  /**
@@ -954,7 +954,7 @@ class WebSocketConnection {
954
954
  * @param lastSessionId - Optional lastSessionId if there was a previous connection
955
955
  * @returns connection url
956
956
  */
957
- static connectionURL_(repoInfo, transportSessionId, lastSessionId, appCheckToken) {
957
+ static connectionURL_(repoInfo, transportSessionId, lastSessionId, appCheckToken, applicationId) {
958
958
  const urlParams = {};
959
959
  urlParams[VERSION_PARAM] = PROTOCOL_VERSION;
960
960
  if (!isNodeSdk() &&
@@ -972,6 +972,9 @@ class WebSocketConnection {
972
972
  if (appCheckToken) {
973
973
  urlParams[APP_CHECK_TOKEN_PARAM] = appCheckToken;
974
974
  }
975
+ if (applicationId) {
976
+ urlParams[APPLICATION_ID_PARAM] = applicationId;
977
+ }
975
978
  return repoInfoConnectionURL(repoInfo, WEBSOCKET, urlParams);
976
979
  }
977
980
  /**
@@ -986,6 +989,7 @@ class WebSocketConnection {
986
989
  // Assume failure until proven otherwise.
987
990
  PersistentStorage.set('previous_websocket_failure', true);
988
991
  try {
992
+ let options;
989
993
  if (isNodeSdk()) {
990
994
  const device = this.nodeAdmin ? 'AdminNode' : 'Node';
991
995
  // UA Format: Firebase/<wire_protocol>/<sdk_version>/<platform>/<device>
@@ -1014,17 +1018,8 @@ class WebSocketConnection {
1014
1018
  if (proxy) {
1015
1019
  options['proxy'] = { origin: proxy };
1016
1020
  }
1017
- this.mySock = new WebSocketImpl(this.connURL, [], options);
1018
- }
1019
- else {
1020
- const options = {
1021
- headers: {
1022
- 'X-Firebase-GMPID': this.applicationId || '',
1023
- 'X-Firebase-AppCheck': this.appCheckToken || ''
1024
- }
1025
- };
1026
- this.mySock = new WebSocketImpl(this.connURL, [], options);
1027
1021
  }
1022
+ this.mySock = new WebSocketImpl(this.connURL, [], options);
1028
1023
  }
1029
1024
  catch (e) {
1030
1025
  this.log_('Error instantiating WebSocket.');
@@ -1246,7 +1241,7 @@ WebSocketConnection.responsesRequiredToBeHealthy = 2;
1246
1241
  WebSocketConnection.healthyTimeout = 30000;
1247
1242
 
1248
1243
  const name = "@firebase/database";
1249
- const version = "0.13.0-20220505222723";
1244
+ const version = "0.13.0-canary.094da9eed";
1250
1245
 
1251
1246
  /**
1252
1247
  * @license