Firebase Firestore安全规则失败,因为它们';你太长了

Firebase Firestore安全规则失败,因为它们';你太长了,firebase,google-cloud-firestore,firebase-security,Firebase,Google Cloud Firestore,Firebase Security,看来我的安全规则失败了,因为它们太长了。注释掉的这两个规则会导致整个规则集失败,但是当单独运行在一起时,它们都会成功运行。有没有我不知道的极限 match /transactions/{transactionId} { allow create, update: if isSignedIn() && validateTransactionSchema() &&

看来我的安全规则失败了,因为它们太长了。注释掉的这两个规则会导致整个规则集失败,但是当单独运行在一起时,它们都会成功运行。有没有我不知道的极限

match /transactions/{transactionId} {

    allow create, update: if
                    isSignedIn() &&
                    validateTransactionSchema() &&

                    // Succeeds when these rules are left out.
                    // These rules succeed on their own, but not when combined with others
                    // (incomingData().categoryId == null || categoryExists(incomingData().categoryId)) &&
                    // (incomingData().payeeId == null || payeeExists(incomingData().payeeId)) &&

                    accountExists(incomingData().accountId) &&
                    isBudgetOwner() &&
                    isPremium();

    function validateTransactionSchema() {
        return incomingData().keys().hasAll(['transactionDate', 'accountId', 'payeeId', 'categoryId', 'splits', 'memo', 'amount', 'cleared', 'locked']) &&
                                incomingData().size() == 9 &&
                                incomingData().transactionDate is timestamp &&
                                incomingData().accountId is string &&
                                (incomingData().payeeId == null || incomingData().payeeId is string) &&
                                (incomingData().categoryId == null || incomingData().categoryId is string) &&
                                incomingData().splits is list &&
                                (incomingData().memo == null || incomingData().memo is string) &&
                                incomingData().amount is number &&
                                incomingData().cleared is bool &&
                                incomingData().locked is bool;
    }
}

function isSignedIn() {
    return request.auth != null;
}

function isPremium() {
    return get(/databases/$(database)/documents/users/$(request.auth.uid)).data.isPremium == true;
}

function isBudgetOwner() {
    return get(/databases/$(database)/documents/budgets/$(budgetId)).data.userId == request.auth.uid;
}

function categoryExists(categoryId) {
    return exists(/databases/$(database)/documents/budgets/$(budgetId)/categories/$(categoryId));
}

function accountExists(accountId) {
    return exists(/databases/$(database)/documents/budgets/$(budgetId)/accounts/$(accountId));
}

function payeeExists(payeeId) {
    return exists(/databases/$(database)/documents/budgets/$(budgetId)/payees/$(payeeId));
}

function incomingData() {
    return request.resource.data;
}   

鲍勃·斯奈德(Bob Snyder)披露的限额已提高到10。这应该有助于你的处境。
根据:

如果您有可靠的复制案例,请提交一份包含详细信息的错误报告。您可能达到了Firebaser中所述的限制:目前,我们将给定规则计算中get()和exists()调用的数量限制为three@BobSnyder是的,这似乎是这里的问题。如果您在文档中找不到此信息,那么提交错误报告仍然可以。我不能。