Hi
I run a web site that takes home automation data from third-party sources, processes it and uses various visualisations to display to users. There a free and subscription tiers with paying customers getting more options. I have separate development and production sites using MongoDB Atlas to host the site and run the business logic.
I got a message from a user yesterday saying that their data was corrupted and when I investigated, I found that yesterday (14th June) at around 06:00 UTC a piece of code started behaving differently. Essentially it GETs JSON data froma remote server and walks through the data and stores it in the database according to a set of rules. One line of code detected if a value was a string:
if( typeof value === 'string' )
where value comes from an array that was passed to the function. This used to return true for “abc” and false for “123” but now returns true for both. I have now changed the code to say:
if( isNaN( value ) )
which works consistently. Checking the logs, I can see that the behaviour of the code was changing on different executions, likely indicating that an update of some kind had been pushed to some servers but not others. I have tens of millions of records in the relevant collections and unfortunately it left my data in an inconsistent state and have had to spend hours cleaning up the data.
Whilst the change in behaviour is minor, it broke a production web site on code that has been previously working for months. Has there been some kind of upgrade, to the JavaScript version or JSON libraries or similar?
Has anyone else experienced any breaking changes recently?
Maybe I missed the email or didn’t understand the significance of it but how do we get to find out about these changes ahead of time and test our code against any potentially harmful changes?
Many thanks
Simon