Skip to content

Commit

Permalink
Pass singleProjectMode config down to the database emulator and bump …
Browse files Browse the repository at this point in the history
…the version to 4.10.0. (#5068)

Pass singleProjectMode config down to the database emulator and bump the version to 4.10.0. (#5068)
  • Loading branch information
christhompsongoogle committed Oct 7, 2022
1 parent 9f86b0f commit e08c6d4
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
@@ -0,0 +1 @@
- Enable single project mode for the database emulator (#5068).
2 changes: 2 additions & 0 deletions src/emulator/controller.ts
Expand Up @@ -712,6 +712,8 @@ export async function startAll(
port: databaseAddr.port,
projectId,
auto_download: true,
// Only set the flag (at all) if singleProjectMode is enabled.
single_project_mode: singleProjectModeEnabled ? "Warning" : undefined,
};

// Try to fetch the default RTDB instance for a project, but don't hard-fail if we
Expand Down
1 change: 1 addition & 0 deletions src/emulator/databaseEmulator.ts
Expand Up @@ -21,6 +21,7 @@ export interface DatabaseEmulatorArgs {
functions_emulator_port?: number;
functions_emulator_host?: string;
auto_download?: boolean;
single_project_mode?: string;
}

export class DatabaseEmulator implements EmulatorInstance {
Expand Down
18 changes: 12 additions & 6 deletions src/emulator/downloadableEmulators.ts
Expand Up @@ -27,14 +27,14 @@ const CACHE_DIR =

export const DownloadDetails: { [s in DownloadableEmulators]: EmulatorDownloadDetails } = {
database: {
downloadPath: path.join(CACHE_DIR, "firebase-database-emulator-v4.9.0.jar"),
version: "4.9.0",
downloadPath: path.join(CACHE_DIR, "firebase-database-emulator-v4.10.0.jar"),
version: "4.10.0",
opts: {
cacheDir: CACHE_DIR,
remoteUrl:
"https://storage.googleapis.com/firebase-preview-drop/emulator/firebase-database-emulator-v4.9.0.jar",
expectedSize: 34204485,
expectedChecksum: "1c3f5974f0ee5559ebf27b56f2e62108",
"https://storage.googleapis.com/firebase-preview-drop/emulator/firebase-database-emulator-v4.10.0.jar",
expectedSize: 34230230,
expectedChecksum: "e99b23f0e723813de4f4ea0e879b46b0",
namePrefix: "firebase-database-emulator",
},
},
Expand Down Expand Up @@ -144,7 +144,13 @@ const Commands: { [s in DownloadableEmulators]: DownloadableEmulatorCommand } =
database: {
binary: "java",
args: ["-Duser.language=en", "-jar", getExecPath(Emulators.DATABASE)],
optionalArgs: ["port", "host", "functions_emulator_port", "functions_emulator_host"],
optionalArgs: [
"port",
"host",
"functions_emulator_port",
"functions_emulator_host",
"single_project_mode",
],
joinArgs: false,
},
firestore: {
Expand Down

0 comments on commit e08c6d4

Please sign in to comment.