Skip to content

fix: prevent ghost changes when SSL data is empty or invalid#80

Open
manganate006 wants to merge 1 commit intoLissy93:mainfrom
manganate006:fix/ssl-empty-values-ghost-changes
Open

fix: prevent ghost changes when SSL data is empty or invalid#80
manganate006 wants to merge 1 commit intoLissy93:mainfrom
manganate006:fix/ssl-empty-values-ghost-changes

Conversation

@manganate006
Copy link

Summary

  • Fix ghost changes being recorded in domain_updates when SSL certificate fetch fails or returns empty data
  • Skip recording changes when both old and new values are empty
  • Skip recording date changes when new value is invalid/empty (NaN case)
  • Skip recording non-date changes when new value is empty but old value exists (fetch failure scenario)

Problem

When SSL certificate fetching fails (timeout, network error, etc.), the updateSSL function was recording "changes" with empty or invalid values. This resulted in confusing entries in the Change History page showing entries like:

SSL Valid From changed
25 févr. 2026 -

With no meaningful old/new values displayed.

Root Cause

The date comparison logic at line 86:

if (isNaN(diffInDays) || diffInDays > 1) {

When SSL fetch fails, fresh.valid_from and fresh.valid_to are empty strings. new Date("") creates an invalid date, making diffInDays become NaN. The condition isNaN(diffInDays) evaluates to true, causing a "change" to be recorded even though there's no actual new data.

Evidence from database

SELECT * FROM domain_updates WHERE change_type LIKE 'ssl_%';

Shows entries with old_value = '', new_value = '' or new_value = '0'.

Test plan

  • Verify that legitimate SSL certificate changes are still recorded correctly
  • Verify that SSL fetch failures no longer create ghost entries in domain_updates
  • Check Change History page shows only meaningful changes

🤖 Generated with Claude Code

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
@vercel
Copy link

vercel bot commented Feb 25, 2026

@manganate006 is attempting to deploy a commit to the AS93 Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant