Problem
After an upgrade, the Total Components count in the dashboard is significantly reduced. This can lead to concern that the upgrade has deleted components.
Cause
Release 3.77.0 introduced a change to the way Nuget V2 components are counted.
Nuget V2 downloads complete metadata for a requested component which generates a component record for every version, even though they haven't been downloaded and no underlying asset exists in the blobstore.
The component count DB query needed to be corrected to only include components with assets.
Further information
To verify the displayed dashboard count, the following DB query can be executed
SELECT COUNT(DISTINCT component_id) FROM <FORMAT>_asset WHERE asset_blob_id IS NOT NULL;
Be aware that the dashboard Total Components count only updates at the top of the hour, so the DB query and the UI value may differ for a period of time.