Skip to content

fix(delete-user-data): kit/extension parity – invalid .env values deploy and silently delete less data #3258

Open

Description

@CorieW

delete-user-data kit/extension parity. Priority: high. Invalid config deploys fine and then deletes less data than intended.

Difference

  • Extension: rejects invalid values at install time: a select value that isn't an option, or a value that fails validationRegex.
  • Kit: firebase-tools only validates params it prompts for. Values already in .env are used exactly as written, so invalid values deploy and then quietly misbehave.
.env value Extension Kit
FIRESTORE_DELETE_MODE=RECURSIVE rejected runs as shallow, so subcollections are left behind
ENABLE_AUTO_DISCOVERY=true rejected auto-discovery is off
SELECTED_DATABASE_LOCATION=us-east1 rejected builds an RTDB URL that doesn't exist
SELECTED_DATABASE_INSTANCE=https://x.firebaseio.com rejected accepted
CLOUD_STORAGE_BUCKET=gs://x rejected accepted

Note: the extension also accepts an option label (Recursive, Yes). It stores the label as-is, and its runtime then misbehaves the same way the kit does. That's an existing extension bug, not a parity gap.

Reproduced

  • Extension: the validateOnly instances API rejected every value in the table, e.g. param provided with invalid option RECURSIVE, must be one of recursive, shallow.
  • Kit: deployed with FIRESTORE_DELETE_MODE=RECURSIVE and ENABLE_AUTO_DISCOVERY=true. Deleting a user removed users/<uid> but left users/<uid>/sub/s1, and a doc with uid: <uid> was never discovered.

Code

Resolution

Validate these five params at module load, next to assertRequiredParams() (config.ts#L226-L260), so deploy-time discovery fails the way an extension install does. Reject select values outside the option values, and reject values that fail the extension's regexes. Rejecting labels too would be stricter than the extension, and safer. Same pattern as assertRequiredParams() and storage-resize-images' validatePathListsFromEnv(); #3169 (open, into next) proposes similar checks for IMAGE_TYPE. Every kit gets .env values the same way, so other kits likely have the same gap.

Activity

  1. self-assigned this
    on Oct 20, 2026
  2. added a commit that references this issue on Oct 27, 2026
    55b750b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions