chore: made code more robust to undefined expiry#6625
Merged
CommanderStorm merged 4 commits intolouislam:masterfrom Jan 6, 2026
Merged
chore: made code more robust to undefined expiry#6625CommanderStorm merged 4 commits intolouislam:masterfrom
CommanderStorm merged 4 commits intolouislam:masterfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug where domain expiry notifications could display "NaN days" when the expiry date is null or undefined. The fix adds a defensive check before calculating days remaining, preventing the notification from being sent with invalid data.
- Added validation to skip notifications when domain expiry is null/undefined
- Added regression tests for both null and undefined expiry scenarios
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| server/model/domain_expiry.js | Added check to return early if domain.expiry is falsy, preventing NaN calculation |
| test/backend-test/test-domain.js | Added two regression tests to verify notifications are not sent when expiry is null or undefined |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ℹ️ To keep reviews fast and effective, please make sure you’ve read our pull request guidelines
📝 Summary of changes done and why they are done
Not sure if this is just a bandait fix, but it gets the job done and is good under defensive programmingn anyhow.