Skip to content

fix(firestore-send-email): kit/extension parity – kit uninstall leaves the function running or its secrets behind #3297

Open

Description

@CorieW

firestore-send-email kit/extension parity. Priority: medium. Uninstalling a kit set up the way the README describes leaves the function running and still sending mail. A successful uninstall also leaves the instance's secrets behind.

Difference

  • Extension: deleting the instance removes the function, the service account, its IAM bindings and its managed secrets.
  • Kit (firebase functions:kits:uninstall --instance <id>, firebase-tools 15.31.0):
    • Plain .env (the README's Usage layout): the command exits 0 and removes the instance from firebase.json, but deletes nothing. It warns only that the config folder "still contains files (.env)". The function stays deployed and keeps processing the mail collection.
    • Any other .env.<x> file in the folder (for example .env.bak): the command fails with Instance at … contains no .env file for current project.
    • With .env.<projectId>: the function and service account are deleted, but the four kit-<id>-* secrets stay in Secret Manager (one holds the SMTP password), along with four deleted:serviceAccount:… IAM bindings.

Reproduced

  • Plain .env: uninstall exited 0, the instance left firebase.json, and kit-sepeu-processQueue stayed ACTIVE.
  • With .env.corie-testing: the function and service account were deleted. kit-sepmig2-{SMTP_PASSWORD,CLIENT_ID,CLIENT_SECRET,REFRESH_TOKEN} and four dangling project IAM bindings remained.
  • Extension: deleting the instance left no function, service account or IAM binding.

Code

  • Kit README tells users to configure with .env: README.md#L49, #L85-L90
  • The behaviour itself is in firebase-tools commands/functions-kits-uninstall.js (only .env.<project> files are acted on; secrets are not deleted).

Resolution

Same as #3262 for delete-user-data:

  • the CLI should also act on a plain .env, or refuse with a clear error;
  • it should offer to delete the kit-<id>-* secrets.

Until then, the README should say to use .env.<projectId> and to delete the secrets by hand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions