Skip to content
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

🐛 [firestore-send-email] delete email documents on TTL expire #1946

Closed
balee opened this issue Feb 5, 2024 · 4 comments · May be fixed by #2246
Closed

🐛 [firestore-send-email] delete email documents on TTL expire #1946

balee opened this issue Feb 5, 2024 · 4 comments · May be fixed by #2246
Assignees
Labels
documentation Improvements or additions to documentation extension: firestore-send-email Related to firestore-send-email extension type: bug Something isn't working

Comments

@balee
Copy link

balee commented Feb 5, 2024

[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.1.27
  • Configuration values (redact info where appropriate):
    • Cloud Functions location: us-central1
    • SMTP connection URI: redacted
    • SMTP password (Optional): redacted
    • Email documents collection: mail
    • Default FROM address: redacted
    • Firestore TTL type: day
    • Firestore TTL value: 5
    • remaining optional parameters are not set

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

  1. Configure the plugin as described in the documentation, also set TTL type to day and TTL value to 5.
  2. Send some emails with the plugin.
  3. Note, that the emails are sent and received by the recipients as expected.
  4. Wait until the specified TTL is elapsed (and some weeks more, just to be sure)
Expected result

The documents in the configured collection are expected to be deleted automatically.

Actual result

The documents are never deleted.

Please note, that it is not even possible to manually set up a TTL policy, because expireAt field is at 2nd level in the document created by the plugin, however, only 1st level fields can be configure as timestamp field when creating a TTL policy (see https://console.cloud.google.com/firestore/databases/-default-/ttl)

Example document:

email-retu

@balee balee added the type: bug Something isn't working label Feb 5, 2024
@jauntybrain jauntybrain added the extension: firestore-send-email Related to firestore-send-email extension label Feb 22, 2024
@MasaGon
Copy link

MasaGon commented Feb 24, 2024

I was wondering if it's possible to create a TTL Policy for a 2nd level field by specifying the timestamp field with dot notation, such as "delivery.expireAt". However, if setting the TTL manually is required, I believe it would be beneficial to include this information in the documentation. Unfortunately, I could not find any related instructions. Could you please clarify this?

@ottob
Copy link

ottob commented Mar 15, 2024

its not much help but this works for us. using delivery.expireAt. extension 0.1.30

@balee
Copy link
Author

balee commented Mar 24, 2024

Indeed, a TTL policy with delivery.expireAt is working.
The documentation might be a bit more descriptive in this subject, it wasn't even clear for me that I have to create a TTL policy because it is not done automagically.

@pr-Mais pr-Mais added type: feature request New feature or request and removed type: bug Something isn't working labels Aug 7, 2024
@Gustolandia Gustolandia self-assigned this Dec 27, 2024
@Gustolandia Gustolandia added type: bug Something isn't working documentation Improvements or additions to documentation and removed type: feature request New feature or request labels Dec 27, 2024
@Gustolandia
Copy link
Contributor

Documents updated explaining how to add the TTL policy properly. Apologies for the lack of information before. New documents will be merged shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation extension: firestore-send-email Related to firestore-send-email extension type: bug Something isn't working
Projects
None yet
6 participants