Feed aggregator
RAM Is So Expensive, Samsung Won't Even Sell It To Samsung
Read more of this story at Slashdot.
30% of Doctors In UK Use AI Tools In Patient Consultations, Study Finds
Read more of this story at Slashdot.
Subaru Owners Are Ticked About In-Car Pop-Up Ads For SiriusXM
Read more of this story at Slashdot.
Meta Poaches Apple Design Exec Alan Dye
Read more of this story at Slashdot.
New Homes In London Were Delayed By 'Energy-Hungry' Data Centers
Read more of this story at Slashdot.
'End-To-End Encrypted' Smart Toilet Camera Is Not Actually End-To-End Encrypted
Read more of this story at Slashdot.
Top Journal Retracts Study Predicting Catastrophic Climate Toll
Read more of this story at Slashdot.
Russian Astronaut Kicked Out of the US For Stealing Proprietary SpaceX Designs
Read more of this story at Slashdot.
CodeSOD: Pawn Pawn in in Game Game of of Life Life
It feels like ages ago, when document databases like Mongo were all the rage. That isn't to say that they haven't stuck around and don't deliver value, but gone is the faddish "RDBMSes are dead, bro." The "advantage" they offer is that they turn data management problems into serialization problems.
And that's where today's anonymous submission takes us. Our submitter has a long list of bugs around managing lists of usernames. These bugs largely exist because the contract developer who wrote the code didn't write anything, and instead "vibe coded too close to the sun", according to our submitter.
Here's the offending C# code:
[JsonPropertyName("invitedTraders")] [BsonElement("invitedTraders")] [BsonIgnoreIfNull] public InvitedTradersV2? InvitedTraders { get; set; } [JsonPropertyName("invitedTradersV2")] [BsonElement("invitedTradersV2")] [BsonIgnoreIfNull] public List<string>? InvitedTradersV2 { get; set; }Let's start with the type InvitedTradersV2. This type contains a list of strings which represent usernames. The field InvitedTradersV2 is a list of strings which represent usernames. Half of our submitter's bugs exist simply because these two lists get out of sync- they should contain the same data, but without someone enforcing that correctly, problems accrue.
This is made more frustrating by the MongoDB attribute, BsonIgnoreIfNull, which simply means that the serialized object won't contain the key if the value is null. But that means the consuming application doesn't know which key it should check.
For the final bonus fun, note the use of JsonPropertyName. This comes from the built-in class library, which tells .NET how to serialize the object to JSON. The problem here is that this application doesn't use the built-in serializer, and instead uses Newtonsoft.JSON, a popular third-party library for solving the problem. While Newtonsoft does recognize some built-in attributes for serialization, JsonPropertyName is not among them. This means that property does nothing in this example, aside from add some confusion to the code base.
I suspect the developer responsible, if they even read this code, decided that the duplicated data was okay, because isn't that just a normal consequence of denormalization? And document databases are all about denormalization. It makes your queries faster, bro. Just one more shard, bro.
[Advertisement] Keep all your packages and Docker containers in one place, scan for vulnerabilities, and control who can access different feeds. ProGet installs in minutes and has a powerful free version with a lot of great features that you can upgrade when ready.Learn more.Valve Reveals Its the Architect Behind a Push To Bring Windows Games To Arm
Read more of this story at Slashdot.
AT&T and Verizon Are Fighting Back Against T-Mobile's Easy Switch Tool
Read more of this story at Slashdot.
OpenAI Loses Fight To Keep ChatGPT Logs Secret In Copyright Case
Read more of this story at Slashdot.
White House Rolls Back Fuel Economy Standards
Read more of this story at Slashdot.
The Last Video Rental Store Is Your Public Library
Read more of this story at Slashdot.
After AI Push, Trump Administration Is Now Looking To Robots
Read more of this story at Slashdot.
After Nearly 30 Years, Crucial Will Stop Selling RAM To Consumers
Read more of this story at Slashdot.
HBO Max Botches Mad Men's 4K Debut After Streaming Wrong File Showing Visible Crewmembers
Read more of this story at Slashdot.
YouTube Releases Its First-Ever Recap of Videos You've Watched
Read more of this story at Slashdot.
India Pulls Its Preinstalled iPhone App Demand
Read more of this story at Slashdot.
Windows 11 Growth Slows As Millions Stick With Windows 10
Read more of this story at Slashdot.
