fix: prevent ghost changes when SSL data is empty or invalid#80
Open
manganate006 wants to merge 1 commit intoLissy93:mainfrom
Open
fix: prevent ghost changes when SSL data is empty or invalid#80manganate006 wants to merge 1 commit intoLissy93:mainfrom
manganate006 wants to merge 1 commit intoLissy93:mainfrom
Conversation
When SSL certificate fetch fails (timeout, network error), the fresh values are empty strings. The date comparison logic was triggering isNaN(diffInDays) which recorded a "change" with empty old/new values, polluting the change history. This fix: - Skips recording changes when both old and new values are empty - Skips recording changes when new date value is invalid/empty (NaN case) - Prevents ghost entries in domain_updates table
|
@manganate006 is attempting to deploy a commit to the AS93 Team on Vercel. A member of the Team first needs to authorize it. |
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.
Summary
domain_updateswhen SSL certificate fetch fails or returns empty dataProblem
When SSL certificate fetching fails (timeout, network error, etc.), the
updateSSLfunction was recording "changes" with empty or invalid values. This resulted in confusing entries in the Change History page showing entries like:With no meaningful old/new values displayed.
Root Cause
The date comparison logic at line 86:
When SSL fetch fails,
fresh.valid_fromandfresh.valid_toare empty strings.new Date("")creates an invalid date, makingdiffInDaysbecomeNaN. The conditionisNaN(diffInDays)evaluates totrue, causing a "change" to be recorded even though there's no actual new data.Evidence from database
Shows entries with
old_value = '',new_value = ''ornew_value = '0'.Test plan
🤖 Generated with Claude Code