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

Fix multiple notifications at once bug #667

Merged
merged 2 commits into from
Apr 26, 2023

Conversation

SerpentBytes
Copy link
Contributor

@SerpentBytes SerpentBytes commented Apr 25, 2023

Description

Fixes #650 by making adjustments to expiration notification-related code for DNS records and Certificates. Attempts to fix the annoying bug of getting too many notifications at once regarding expiring records.
It seems like the root cause of getting multiple notifications was because we were checking if lastNotified is set to null OR lastNotified is set to date, which is 30 days in the past. Since we are sending one reminder for now, we don't need to verify whether it has been a month since we last notified the user.

Steps to test

  1. Run the project locally
  2. Request a certificate or DNS record
  3. Run npm run db:studio and set the expiration date to a month in the future
  4. Navigate to http://localhost:8025 to see a single notification after some time:

demo

@SerpentBytes SerpentBytes self-assigned this Apr 25, 2023
@SerpentBytes SerpentBytes added bug Something isn't working category: notifications A service to notify users about their certificates/domains labels Apr 25, 2023
 * attempt to make exipiration notifications work
 * remove unused constant
 * update condition for the dnsRecords query
 * add comments
@SerpentBytes SerpentBytes marked this pull request as ready for review April 26, 2023 13:55
@SerpentBytes
Copy link
Contributor Author

SerpentBytes commented Apr 26, 2023

I am not running into issues with certificate failure yielding duplicate notifications locally:

Screenshot 2023-04-26 at 10 12 48 AM

@humphd
Copy link
Contributor

humphd commented Apr 26, 2023

We only run a single instance locally, so we should do this and test in staging. I'm going to merge this so people can test, and we'll iterate.

@humphd humphd merged commit 536c65e into DevelopingSpace:main Apr 26, 2023
@SerpentBytes SerpentBytes deleted the issue-655 branch April 26, 2023 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working category: notifications A service to notify users about their certificates/domains
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multiple notifications for certificate failure
2 participants