Avatar

Oi, that was stupid (DBO)

by Beorn @, <End of Failed Timeline>, Thursday, May 21, 2015, 23:05 (3271 days ago) @ MacAddictXIV

Okay, so… Cody was right. That little hiccup was an issue with "not enough testing" on my end before publishing. For those who even care about such things, here's the skinny…

There is a "FTB settings" table in the database exclusively for storing information related to your FTB preferences. Right now it only contains the filtering options, but later it will hold RSVP info and, maybe, other things.

Here's the rub… the system only creates a database row for you only if you've bothered to set any preferences at all. If you don't have preferences, it returns a null data set with empty placeholders for various options. This is how the rest of the code knows whether or not you've set preferences or not. The first time you do set a preference, it's supposed to create a new row for you that's populated with data instead of null values, and the code reacts accordingly.

Only that whole "return the empty placeholders" thing wasn't actually working for everybody else but me. Because I tested the system immediately after publishing, there were no rows in the database before me and everything worked as planned. But when everyone else tried to set preferences, the database was returning my account's preferences instead of a blank row. This meant that the database thought it didn't need to insert a record, so it was attempting to run UPDATE operations on rows that didn't exist. Thus, no data got saved.

Turns out I forgot to insert two characters (a = and a 0, in that order) at the proper place in the SQL query. After I finally tracked down what was happening, the fix was easy.


Complete thread:

 RSS Feed of thread