Skip to content

fix(firestore-send-email): kit/extension parity – ext:migrate truncates settings containing # #3303

Open

Description

@CorieW

firestore-send-email kit/extension parity. Priority: low. ext:migrate cuts off any setting that contains #.

Difference

  • Extension: values are stored as entered. DEFAULT_FROM and MAIL_COLLECTION accept #, and DEFAULT_REPLY_TO, USERS_COLLECTION and TEMPLATES_COLLECTION aren't validated.
  • Kit:
    • ext:migrate, ext:export and kits:install write values to .env unquoted unless they contain an escape character.
    • The .env parser then treats # as the start of a comment.
    • The kit never re-validates .env values, so nothing catches the shortened value.

Reproduced

Values written and read back with firebase-tools 15.31.0's own .env writer and parser:

Extension value Kit reads
DEFAULT_FROM=Support #1 <support@example.com> Support (every send without a from fails)
DEFAULT_REPLY_TO=orders#eu@example.com orders
MAIL_COLLECTION=mail#v2 mail (the kit watches the wrong collection)

Code

  • Extension regexes allowing #: extension.yaml#L311, #L325
  • The writer is firebase-tools functions/env.js formatUserEnvForWrite.

Resolution

Fix upstream in firebase-tools by quoting values that contain # (or whitespace) when writing .env. Until then, document it in the kit's migration notes.

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