Change:
if (user[certType]) { const { completedChallenges = [] } = user; <del> const { completedDate = new Date() } = _.find(completedChallenges, ({ id }) => certId === id) || {}; </del> <ins> const certChallenge = _.find( completedChallenges, ({ id }) => certId === id ); let { completedDate = new Date() } = certChallenge || {}; // the challange id has been rotated for isDataVisCert // so we need to check for id 561add10cb82ac38a17513b3 if (certType === 'isDataVisCert' && !certChallenge) { console.log('olderId'); let oldDataVisIdChall = _.find( completedChallenges, ({ id }) => '561add10cb82ac38a17513b3' === id ); if (oldDataVisIdChall) { completedDate = oldDataVisIdChall.completedDate || completedDate; } } </ins> const { username, name } = user; return res.json({

Discussion:
There is a disparity between the current Legacy Data Vis Cert ID and what was once the Data Vis Cert at the beginning of 2018. Legacy Cert id for Data Viz: (on master) Legacy Data Vis Cert id found in some user records:
I did some related investigating on this...
I think there is a similar problem with fullstack certs. I am curious, how did you find out they were different?

When viewing my Legacy Data Visualization Certificate, the Issued date in the top right corner always displays the current date, not the date the Certificate was completed. See: (appears to always have the current date there)
I'll also add, although it may need a new thread or belong somewhere else, that the legacy certificates that were already earned should not be rebranded as "legacy certificates" because it devalues the work that went into getting them when they were not legacy. The date issued and the certificate should suffice. Universities don't send out new diplomas when they change their curriculum with new information saying your BS/MS/MA/MD degree is "legacy".
Rebranding the certificates as "legacy" could also cause problems for folks job hunting. Potential employers seeing a "legacy certificate" may conclude that the work accomplished is already out of date.
I see seemingly correct dates for my legacy front-end and back-end certs, but the legacy data visualization is showing today's date. any thoughts on removing the "legacy" label - they do make a good point, although there would be two certs with the same name (data visualization) - which could be confusing or cause problems.
I've been poking around the code a bit for this one. My guess is that in , line 427, completeDate is null, which would always give the current date for the ctor of the Date class when this happens. Which implies that somehow completeDate isn't getting set. I'm still working through lines 418-421 trying to guess what's going on there (my background is C / C++, so declaring const {} on the left hand side is throwing me for a loop).
so the user object probly looks like this... obviously with a bunch of other properties in the user object as well I think pulls the completedChallenges array from the user object and sets it to the completedChallenges variable - and maybe gives and empty array as a default value if its not found - i think that's how it works this lesson and the ones following it might help...
Thanks . I also found this last night So completedChallenges is an array pulled from the user object using destructuring with a default assignment. completedDate is looking through the completedChallenges array (".find(...)") trying to match id with the certId.

I'll guess completedChallenges is an array of objects, in which each object includes an id and completedDate field. This code is used for all certs, but only the Legacy Data Visualization has a problem here, so this code in and of itself is probably correct. Which implies that the data being fed into it is a problem, such that it can't find a completedDate for the Legacy Data Visualization cert only. So my thoughts are: Possible mismatch between id and certId. Did this id change inadvertently between the old site and the new site? Were completedDates saved for the old Data Visualization Certificate in the first place? I think the next step to debug this would be to just the values of id, certId, & completedChallenges[] on an instance with access to whatever backend storage FreeCodeCamp actually uses. Should be easy to find from that point on, since this is 100% reproducible. Unfortunately, I don't have that kind of access, so I don't think I'm going any farther with this bug. Hopefully this offers a jump start to whomever picks this bug up in the future.
nice digging - I wonder if it's a naming conflict, it's the only legacy cert with the same name as a new one
I cannot reproduce this on my local version - leads me to think that anyone who would claim the certification since the new site went live would not have this problem... I downloaded all my data from the settings page of the live site - I cannot find the string of the "legacyDataVisId" anywhere in my downloaded data (the string is from ). I can find the strings of all the other certs I have claimed - So the id got changed somewhere along the lines I'm guessing - the downloaded data is hard to decipher, but it looks like there may have been two sections for data vis that got created when you claimed the cert on the old site... I cut some code out but these are surrounded by projects required for the cert