Skip to content

fix(delete-user-data): recommend .env.<projectId> and document kit uninstall - #3284

Merged
CorieW merged 14 commits into
kitsfrom
fix/kits-delete-user-data-uninstall-docs
Nov 10, 2026
Merged

CorieW merged 14 commits into
kitsfrom
fix/kits-delete-user-data-uninstall-docs

Conversation

@CorieW

@CorieW CorieW commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Recommends .env.<projectId> for kit config and adds an Uninstall section to the README. firebase functions:kits:uninstall only deletes resources when the instance has a .env.<projectId> file. With the plain .env the README suggested, uninstall exits 0, but the functions keep running and keep deleting user data. Fixes #3262. Part of #3249.

Changes

  • README: .env → .env.<projectId>, noting that a plain .env deploys the same way but uninstall ignores it.
  • README: new Uninstall section: the command, what it removes, how to recover after uninstalling with a plain .env, and what's left behind compared with the extension (two Pub/Sub topics, and the deleted service account's IAM bindings).
  • CHANGELOG entry.

Testing

On corie-testing with firebase-tools 15.31.0, I installed firebase/delete-user-data@0.1.30 and three kit instances from origin/kits, then uninstalled each:

  • r3262-ext: extension, with firebase ext:uninstall --immediate.
  • r3262-kit: kit with a plain .env (old README).
  • r3262-fix: kit set up as the new README says.
  • r3262-rec: kit with a plain .env, uninstalled, then recovered as the new README says.
Extension Kit before (plain .env) Kit after (.env.<projectId>, and after recovery)
Uninstall result exit 0 exit 0, instance removed from firebase.json exit 0, instance removed from firebase.json
Functions, Run services, Eventarc triggers, subscriptions removed all still running removed
Service account deleted kept deleted
Project IAM bindings removed (4) kept (7) 7 deleted:serviceAccount: bindings left
Pub/Sub topics 2 kept 3 kept (2 kit topics + the Auth trigger's Eventarc topic) 2 kept
Deleting a test user after uninstall — its Firestore doc was deleted ~10s later its doc was still there after 180s
  • .env.corie-testing loads the same values as .env; the deployed env vars matched apart from the instance id.
  • npx vitest run passes (119 tests). Prettier passes on my edits (the README tables already failed before).
  • tsc -b passes with @types/node temporarily installed; without it pnpm build fails, which this change doesn't cause.
  • I couldn't run the README's gcloud projects remove-iam-policy-binding command here.

…tall

functions:kits:uninstall only deletes deployed resources for a project with a .env.<projectId> file, so with a plain .env the kit kept running after uninstall. Recommend .env.<projectId> and add an Uninstall section covering the topics and IAM bindings it leaves behind.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the documentation for the delete-user-data kit, recommending the use of .env.<projectId> instead of a plain .env file to ensure that the firebase functions:kits:uninstall command can properly identify and delete deployed resources. It also adds a detailed 'Uninstall' section to the README explaining the uninstallation process and manual cleanup steps. The review feedback suggests shortening the changelog entry for readability, clarifying the explanation of how the uninstall command interacts with plain .env files, and maintaining consistent present tense throughout the new documentation.

Comment thread kits/delete-user-data/CHANGELOG.md Resolved
Comment thread kits/delete-user-data/README.md Resolved
Comment thread kits/delete-user-data/README.md Resolved
Comment thread kits/delete-user-data/README.md Resolved
@CorieW

CorieW commented Oct 20, 2026

Copy link
Copy Markdown
Member Author

For the "Still to fix in firebase-tools", test using latest firebase-tools version. I forgot to update.

Comment thread kits/delete-user-data/README.md Resolved
Comment thread kits/delete-user-data/README.md Resolved
Comment thread kits/delete-user-data/README.md Resolved
Comment thread kits/delete-user-data/README.md Resolved
@@ -1,3 +1,5 @@
- fix: the README now recommends `.env.<projectId>` for instance config and has an Uninstall section. `firebase functions:kits:uninstall` only deletes deployed resources for a project with a `.env.<projectId>` file, so with the plain `.env` the README suggested before, it removed the instance from `firebase.json` and exited without an error but left the functions running and deleting user data. The new section also covers the Pub/Sub topics and IAM role bindings that uninstall leaves behind.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: "Fixes #3262" in the PR description will close the issue before its firebase-tools half is fixed. Use "Part of #3262", or file the firebase-tools issue and link it.

Comment thread kits/delete-user-data/README.md Resolved
Comment thread kits/delete-user-data/README.md Resolved
@CorieW
CorieW marked this pull request as ready for review November 10, 2026 10:45
…data-uninstall-docs

# Conflicts:
#	kits/delete-user-data/CHANGELOG.md
@CorieW
CorieW merged commit 9ec384f into kits Nov 10, 2026
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants