I'm implementing a feature to send an email to customers 24 hours after they uninstall our application. This is done by triggering a HTTP endpoint via Google Cloud Tasks, which checks if the application remains uninstalled before sending the email. The challenge arises as customers might reinstall and uninstall the application within this period. I aim to:
- Ensure the email is sent only once
- Delay the email to be sent 24 hours following the most recent uninstall event
My current implementation with Google Cloud Tasks handles de-duplication effectively, preventing multiple emails by disallowing task creation with duplicate IDs. However, I'm encountering limitations with rescheduling or postponing tasks because:
- Task updates are not supported by Google Cloud Tasks
- Tasks cannot be efficiently deleted and recreated due to ID reuse delays It can take up to 4 hours for the ID to be released.
Given these constraints, how can I manage to have a task execute only once, 24 hours after the latest uninstall event, especially considering multiple uninstall/reinstall events can happen within the 24-hour timeframe?