Skip to content

Commit

Permalink
Limit web frameworks generated functionId to 20 chars max (#6260)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexastrum committed Dec 7, 2023
1 parent 31a2588 commit 9fd1102
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
- Fixed an issue preventing Angular apps using ng-deploy from being emulated or deployed. (#6584)
- Warn if a Web Framework is outside a well known version range on deploy/emulate. (#6562)
- Use Web Framework's well known version range in `firebase init hosting`. (#6562)
- Limit Web Framework's generated Cloud Function name to 20 characters, fixing deploys for some. (#6260)
3 changes: 2 additions & 1 deletion src/frameworks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@ export async function prepareFrameworks(
);
}
const getProjectPath = (...args: string[]) => join(projectRoot, source, ...args);
const functionId = `ssr${site.toLowerCase().replace(/-/g, "")}`;
// Combined traffic tag (19 chars) and functionId cannot exceed 46 characters.
const functionId = `ssr${site.toLowerCase().replace(/-/g, "").substring(0, 20)}`;
const usesFirebaseAdminSdk = !!findDependency("firebase-admin", { cwd: getProjectPath() });
const usesFirebaseJsSdk = !!findDependency("@firebase/app", { cwd: getProjectPath() });
if (usesFirebaseAdminSdk) {
Expand Down

0 comments on commit 9fd1102

Please sign in to comment.