Skip to content

🐛 [firestore-send-email] Validation in version 0.2.1 breaks existing behaviour #2419

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
philitell opened this issue May 15, 2025 · 13 comments · Fixed by #2420 or #2423
Closed

🐛 [firestore-send-email] Validation in version 0.2.1 breaks existing behaviour #2419

philitell opened this issue May 15, 2025 · 13 comments · Fixed by #2420 or #2423
Assignees
Labels
triaged type: bug Something isn't working

Comments

@philitell
Copy link

[READ] Step 1: Are you in the right place?

Issues filed here should be about bugs for a specific extension in this repository.
If you have a general question, need help debugging, or fall into some
other category use one of these other channels:

  • For general technical questions, post a question on StackOverflow
    with the firebase tag.
  • For general Firebase discussion, use the firebase-talk
    google group.
  • To file a bug against the Firebase Extensions platform, or for an issue affecting multiple extensions, please reach out to
    Firebase support directly.

[REQUIRED] Step 2: Describe your configuration

  • Extension name: firestore-send-email
  • Extension version: 0.2.1

[REQUIRED] Step 3: Describe the problem

New validation in Version 0.2.1 breaks existing behaviour. The new validation forces html- or text- property to be not null (error: "ValidationError: Invalid email configuration: Field 'message.html' must be a string."). When using templates those fields are not in use (at least in my case). So updating to version 0.2.1 breaks my production app.
The field "template" is also not nullable anymore (error: "Field 'template' must be object")
Is there a way to deactivte the validation? Is there a way for my to go back to a previous version?

Expected result
Actual result
@cabljac
Copy link
Contributor

cabljac commented May 15, 2025

HI, can you provide your extension configuration? Are you using sendgrid, or some other smtp provider?

@cabljac cabljac self-assigned this May 15, 2025
@cabljac cabljac moved this from Needs Acknowledgment to In Progress in [Cloud] Extensions + Functions May 15, 2025
@cabljac
Copy link
Contributor

cabljac commented May 15, 2025

ah reproduced this, looking into a fix now. Thanks for raising!

@cabljac
Copy link
Contributor

cabljac commented May 15, 2025

In the meantime if you want to downgrade you can alter the URL here, specify the version at the end:

https://console.firebase.google.com/project/_/extensions/install?ref=firebase%[email protected]

@cabljac
Copy link
Contributor

cabljac commented May 15, 2025

Reopening until i release this. After testing I need to make some more changes before we release.

@philitell
Copy link
Author

HI, can you provide your extension configuration? Are you using sendgrid, or some other smtp provider?

I using a standard smtp provider (username + passwort) without any OAuth2
Thanks for working on this issue!!

@cabljac
Copy link
Contributor

cabljac commented May 15, 2025

No worries! Plan to get a release out tomorrow fixing this.

@philitell
Copy link
Author

philitell commented May 15, 2025

For the sake of completeness: this is an example for an email that works fine in version 0.2.0 and that fails due to validation errors in version 0.2.1:

{
  "delivery": {
    "attempts": 1,
    "startTime": "22. April 2025 um 13:26:01 UTC+2",
    "endTime": "22. April 2025 um 13:26:02 UTC+2",
    "error": null,
    "info": {
      "accepted": [
         "[email protected]"
      ],
      "messageId": "<[email protected]>",
      "response": "250 2.0.0 OK <[email protected]> [Hostname=PR3PR05MB6908.eurprd05.prod.outlook.com]",
      "pending": [],
      "rejected": []
    },
    "state": "SUCCESS",
    "leaseExpireTime": null
  },
  "message": {
    "attachments": [
    ],
    "html": null,                             <------- this creates an error
    "text": null                                <------ this creates an error
    "subject": "Bestellbestätigung"
  },
  "template": {
    "data": {
      "address": "Halbenrain 140 Graz",
      "doctorName": "Dr. Andreas",
      "openingHours": "Mo., Mi., Fr. 8:00-12:00Di., Do. 10:30-15:30",
      "orderText": "Some stuff i need",
      "userName": "Pfeiler ",
    },
    "name": "med_order_reply_greimel"
  },
  "to": "[email protected]"
}

@cabljac
Copy link
Contributor

cabljac commented May 16, 2025

shouldn't attachments be an array there?

attachments: An array containing attachment(s); Nodemailer options supported: utf-8 string, custom content type, URL, encoded string, data URI, and pregenerated MIME node (be aware that your email has no access to the cloud server's file system).

from the docs

I mean it may have still failed due to poor validation

@philitell
Copy link
Author

Yes it is an array - only the text i copied to this issue was not correct. In my app/database it is always an array.

@cabljac
Copy link
Contributor

cabljac commented May 16, 2025

but also i'm confused, html and text shouldn't be under attachments according to docs. Attachments should abide by the Nodemailer interface:

https://nodemailer.com/message/attachments/

html and text should live under message or in your template doc?

@philitell
Copy link
Author

ah - i generated this json based on a screenshot of a firestore database entry with copilot aaaand did not check the result. I'm fixing it.

@github-project-automation github-project-automation bot moved this from Needs Acknowledgment to Done in [Cloud] Extensions + Functions May 16, 2025
@cabljac
Copy link
Contributor

cabljac commented May 16, 2025

Reopening again until this is fixed - there are release process issues now, waiting on those to be fixed

@cabljac cabljac reopened this May 16, 2025
@github-project-automation github-project-automation bot moved this from Done to Needs Acknowledgment in [Cloud] Extensions + Functions May 16, 2025
@cabljac cabljac moved this from Needs Acknowledgment to Triaged in [Cloud] Extensions + Functions May 19, 2025
@cabljac cabljac moved this from Triaged to In Review in [Cloud] Extensions + Functions May 19, 2025
@cabljac
Copy link
Contributor

cabljac commented May 19, 2025

triggered release now, closing as complete. If the issue persists somehow then do open a new issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triaged type: bug Something isn't working
Projects
None yet
2 participants