Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
- Fix bug where `functions:secrets:set` didn't remove stale versions of a secret. (#6080)
- Fix issue where Flutter Web is not detected as a web framework. (#6085)
- Fixed bug where `functions:secrets:set` didn't remove stale versions of a secret. (#6080)
- Fixed bug where `firebase deploy --only firestore:named-db` didn't update rules. (#6129)
- Fixed issue where Flutter Web is not detected as a web framework. (#6085)
8 changes: 4 additions & 4 deletions src/deploy/firestore/prepare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ function prepareIndexes(
export default async function (context: any, options: any): Promise<void> {
if (options.only) {
const targets = options.only.split(",");
const onlyIndexes = targets.indexOf("firestore:indexes") >= 0;
const onlyRules = targets.indexOf("firestore:rules") >= 0;
const excludeRules = targets.indexOf("firestore:indexes") >= 0;
const excludeIndexes = targets.indexOf("firestore:rules") >= 0;
const onlyFirestore = targets.indexOf("firestore") >= 0;

context.firestoreIndexes = onlyIndexes || onlyFirestore;
context.firestoreRules = onlyRules || onlyFirestore;
context.firestoreIndexes = !excludeIndexes || onlyFirestore;
context.firestoreRules = !excludeRules || onlyFirestore;
} else {
context.firestoreIndexes = true;
context.firestoreRules = true;
Expand Down
11 changes: 10 additions & 1 deletion src/firestore/fsConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,23 @@ export function getFirestoreConfig(projectId: string, options: Options): ParsedF
onlyDatabases.delete(target);
}
} else if (database) {
if (allDatabases) {
if (allDatabases || onlyDatabases.has(database)) {
results.push(c as ParsedFirestoreConfig);
onlyDatabases.delete(database);
}
} else {
throw new FirebaseError('Must supply either "target" or "databaseId" in firestore config');
}
}

// If user specifies firestore:rules or firestore:indexes make sure we don't throw an error if this doesn't match a database name
if (onlyDatabases.has("rules")) {
onlyDatabases.delete("rules");
}
if (onlyDatabases.has("indexes")) {
onlyDatabases.delete("indexes");
}

if (!allDatabases && onlyDatabases.size !== 0) {
throw new FirebaseError(
`Could not find configurations in firebase.json for the following database targets: ${[
Expand Down