fix(security): keep profile saves working after Generate and billing - #70
Draft
cursor[bot] wants to merge 1 commit into
Draft
cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
…writes Admin persist and credit debit add fields that hasOnly() did not allow, so every later client profile save was rejected. List those keys as allowed-and-protected, and still forbid them on signup create. Co-authored-by: Andy Oliver Rozario <andyrozario7@gmail.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Sep 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
users/{uid}(allReportsReady,toolStatus,creditBalance, etc.).validUserUpdateusedhasOnly(userProfileAllowedKeys())on the merged document, so those extra keys made every later client profile save fail (birth edits, photo URLs, settings).creditBalance.Why this change is safe
request.resource.dataafter a merge includes Admin-written keys that were missing from the allow-list.firestore.rulesplus a unit test that parses the key lists. No app/API refactor.Verification
pnpm exec eslint tests/unit/firestoreUserRules.test.tspnpm test— 74 suites / 397 tests passed, includingtests/unit/firestoreUserRules.test.tsRegression prevention
creditBalance/allReportsReadywrites do not.Release checklist (solo-friendly)
CI / Lint + Jest,CI / Playwright smoke)mainfirebase deploy --only firestore:rules). Repo rules do not apply until deployed.Trigger (concrete)
allReportsReady,pendingToolSlugs,toolStatus,lastProgressAt,mysticalProfileGeneratedAt) or a PAYG Seer/credit pack writescreditBalance/billingMode.updateUserProfile(client SDK).permission-denied. Edits vanish on reload.