@firebase/database 1.0.14 → 1.0.15-20250507150015

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.
@@ -1260,7 +1260,7 @@ WebSocketConnection.responsesRequiredToBeHealthy = 2;
1260
1260
  WebSocketConnection.healthyTimeout = 30000;
1261
1261
 
1262
1262
  const name = "@firebase/database";
1263
- const version = "1.0.14";
1263
+ const version = "1.0.15-20250507150015";
1264
1264
 
1265
1265
  /**
1266
1266
  * @license
@@ -13500,8 +13500,11 @@ let useRestClient = false;
13500
13500
  * Update an existing `Repo` in place to point to a new host/port.
13501
13501
  */
13502
13502
  function repoManagerApplyEmulatorSettings(repo, hostAndPort, emulatorOptions, tokenProvider) {
13503
+ const portIndex = hostAndPort.lastIndexOf(':');
13504
+ const host = hostAndPort.substring(0, portIndex);
13505
+ const useSsl = util.isCloudWorkstation(host);
13503
13506
  repo.repoInfo_ = new RepoInfo(hostAndPort,
13504
- /* secure= */ false, repo.repoInfo_.namespace, repo.repoInfo_.webSocketOnly, repo.repoInfo_.nodeAdmin, repo.repoInfo_.persistenceKey, repo.repoInfo_.includeNamespaceInQueryParams,
13507
+ /* secure= */ useSsl, repo.repoInfo_.namespace, repo.repoInfo_.webSocketOnly, repo.repoInfo_.nodeAdmin, repo.repoInfo_.persistenceKey, repo.repoInfo_.includeNamespaceInQueryParams,
13505
13508
  /*isUsingEmulator=*/ true, emulatorOptions);
13506
13509
  if (tokenProvider) {
13507
13510
  repo.authTokenProvider_ = tokenProvider;
@@ -13711,6 +13714,10 @@ function connectDatabaseEmulator(db, host, port, options = {}) {
13711
13714
  : util.createMockUserToken(options.mockUserToken, db.app.options.projectId);
13712
13715
  tokenProvider = new EmulatorTokenProvider(token);
13713
13716
  }
13717
+ // Workaround to get cookies in Firebase Studio
13718
+ if (util.isCloudWorkstation(host)) {
13719
+ void util.pingServer(host);
13720
+ }
13714
13721
  // Modify the repo to apply emulator settings
13715
13722
  repoManagerApplyEmulatorSettings(repo, hostAndPort, options, tokenProvider);
13716
13723
  }