Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass singleProjectMode config down to the database emulator and bump the version to 4.10.0. #5068

Merged
merged 8 commits into from Oct 7, 2022
3 changes: 2 additions & 1 deletion CHANGELOG.md
@@ -1,3 +1,4 @@
- Enables single project mode for the auth emulator (#5068).
- Enables single project mode for the auth emulator (#4996).
- Fixes issue deploying to Hosting with i18n enabled.
- Fixes issue where deploying to Hosting without Functions permissions would cause deployments to fail with 403 "Permission Denied" errors. (#5071)
- 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