Skip to content

fix(delete-user-data): kit/extension parity – kit uninstall with a plain .env leaves functions running #3262

Open

Description

@CorieW

delete-user-data kit/extension parity. Priority: medium. With a plain .env, "uninstalling" the kit leaves it running and still deleting user data.

Difference

  • Extension: firebase ext:uninstall <id> --immediate deletes the functions, Pub/Sub push subscriptions, service account and its IAM bindings. Only the two topics remain.
  • Kit: firebase functions:kits:uninstall --instance <id> only deletes deployed resources for instances whose config dir has .env.<projectId>. The README tells users to use .env (or .env.<projectId>). With a plain .env, uninstall exits 0, removes the instance from firebase.json, and leaves all three functions, their Eventarc triggers and subscriptions, and the service account with its 7 project roles running.
  • Even with .env.<projectId>, the kit uninstall deletes the service account but leaves its 7 project IAM bindings as deleted:serviceAccount:… entries.

Reproduced

Installed an extension and a kit instance from the same config, then uninstalled both and listed the remaining resources:

Extension Kit, .env Kit, .env.<projectId>
Functions, Run services, triggers, subscriptions removed still running removed
Service account deleted kept deleted
Project IAM bindings removed kept (7) 7 deleted: bindings left
Pub/Sub topics kept (2) kept (3) kept (2)

Code

  • Extension: removal is done by the platform; the resources it removes are declared in extension.yaml#L59-L86.
  • Kit: the README recommends a plain .env (README.md#L56, #L96) and has no uninstall section. The no-op comes from firebase-tools' uninstallInstance, which only cleans up per .env.<project> file.

Resolution

  • README: recommend .env.<projectId> and add an uninstall section (firebase functions:kits:uninstall --instance <id>), with a note to remove any leftover topics.
  • firebase-tools: treat a plain .env as the active project (or refuse with an error instead of exiting 0), and remove IAM bindings before deleting the managed service account.

Activity

  1. CorieW commented on Oct 20, 2026

    @CorieW
    MemberAuthor

    Reproduced on firebase-tools 15.31.0. After functions:kits:uninstall with a plain .env, the kit's functions were still running, and deleting a test user still deleted their Firestore doc about 10s later.

    #3284 fixes the README side: it recommends .env.<projectId> and adds an Uninstall section, including the leftover topics and IAM bindings. Following it removes the functions, triggers, subscriptions and service account, and leaves the two topics, as the extension does.

    The rest needs fixing in firebase-tools:

    • functions:kits:uninstall should treat a plain .env as the current project, or fail with an error, instead of exiting 0 with everything still deployed.
    • It should remove the managed service account's project IAM bindings before deleting the account. Right now it leaves 7 deleted:serviceAccount:firebase-fn-… bindings behind.
  2. self-assigned this
    on Oct 20, 2026
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