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

Revert "Enable preferRest option by default for Firestore functions" #6520

Merged
merged 4 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
- Revert enabling preferRest by default to avoid performance degradations for some users (#6520).
- Fix blocking functions in the emulator when using multiple codebases (#6504).
- Add force flag call-out for bypassing prompts (#6506).
- Fixed an issue where the functions emulator did not respect the `--log-verbosity` flag (#2859).
Expand Down
1 change: 0 additions & 1 deletion src/functions/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@
for (const key of Object.keys(envs)) {
try {
validateKey(key);
} catch (err: any) {

Check warning on line 198 in src/functions/env.ts

View workflow job for this annotation

GitHub Actions / lint (18)

Unexpected any. Specify a different type
logger.debug(`Failed to validate key ${key}: ${err}`);

Check warning on line 199 in src/functions/env.ts

View workflow job for this annotation

GitHub Actions / lint (18)

Invalid type "any" of template literal expression
if (err instanceof KeyValidationError) {
validationErrors.push(err);
} else {
Expand Down Expand Up @@ -260,7 +260,7 @@
* Identifies one and only one dotenv file to touch using the same rules as loadUserEnvs().
* It is an error to provide a key-value pair which is already in the file.
*/
export function writeUserEnvs(toWrite: Record<string, string>, envOpts: UserEnvsOpts) {

Check warning on line 263 in src/functions/env.ts

View workflow job for this annotation

GitHub Actions / lint (18)

Missing return type on function
if (Object.keys(toWrite).length === 0) {
return;
}
Expand Down Expand Up @@ -316,9 +316,9 @@
envsWithoutLocal?: Record<string, string>
): void {
for (const key of keys) {
const definedInEnv = fullEnv.hasOwnProperty(key);

Check warning on line 319 in src/functions/env.ts

View workflow job for this annotation

GitHub Actions / lint (18)

Do not access Object.prototype method 'hasOwnProperty' from target object
if (definedInEnv) {
if (envsWithoutLocal && isEmulator && envsWithoutLocal.hasOwnProperty(key)) {

Check warning on line 321 in src/functions/env.ts

View workflow job for this annotation

GitHub Actions / lint (18)

Do not access Object.prototype method 'hasOwnProperty' from target object
logWarning(
clc.cyan(clc.yellow("functions: ")) +
`Writing parameter ${key} to emulator-specific config .env.local. This will overwrite your existing definition only when emulating.`
Expand Down Expand Up @@ -384,10 +384,10 @@
try {
const data = fs.readFileSync(path.join(functionsSource, f), "utf8");
envs = { ...envs, ...parseStrict(data) };
} catch (err: any) {

Check warning on line 387 in src/functions/env.ts

View workflow job for this annotation

GitHub Actions / lint (18)

Unexpected any. Specify a different type
throw new FirebaseError(`Failed to load environment variables from ${f}.`, {
exit: 2,
children: err.children?.length > 0 ? err.children : [err],

Check warning on line 390 in src/functions/env.ts

View workflow job for this annotation

GitHub Actions / lint (18)

Unsafe assignment of an `any` value

Check warning on line 390 in src/functions/env.ts

View workflow job for this annotation

GitHub Actions / lint (18)

Unsafe member access .children on an `any` value

Check warning on line 390 in src/functions/env.ts

View workflow job for this annotation

GitHub Actions / lint (18)

Unsafe member access .children on an `any` value
});
}
}
Expand All @@ -404,12 +404,11 @@
* @return Environment varibles for functions.
*/
export function loadFirebaseEnvs(
firebaseConfig: Record<string, any>,

Check warning on line 407 in src/functions/env.ts

View workflow job for this annotation

GitHub Actions / lint (18)

Unexpected any. Specify a different type
projectId: string
): Record<string, string> {
return {
FIREBASE_CONFIG: JSON.stringify(firebaseConfig),
GCLOUD_PROJECT: projectId,
FIRESTORE_PREFER_REST: "true",
};
}
Loading