All of Sessions' old votes + the lack of new ones for Strange were going to make things blow up the first time he voted on something. (due to me building the data model in a very dumb way)
Now we have three data models:
senators (array of senator objects, with biographical info, etc)
votes (object where keys correspond to the IDs of each vote on a nominee so far)
voteRecords (object where keys correspond to the ids of each vote, then in that object, the keys correspond to senator IDs and contain the information about how they voted
Also the voteTotals, which haven't changed.
Side note, this makes it easier to migrate to the ProPublica API, because we weren't previously doing a separate API call for senator bio information (just relying on the fact that GovTrack returns it in the vote data) and ProPublica requires that.
All of Sessions' old votes + the lack of new ones for Strange were going to make things blow up the first time he voted on something. (due to me building the data model in a very dumb way)
Now we have three data models:
senators
(array of senator objects, with biographical info, etc)votes
(object where keys correspond to the IDs of each vote on a nominee so far)voteRecords
(object where keys correspond to the ids of each vote, then in that object, the keys correspond to senator IDs and contain the information about how they votedAlso the voteTotals, which haven't changed.
Side note, this makes it easier to migrate to the ProPublica API, because we weren't previously doing a separate API call for senator bio information (just relying on the fact that GovTrack returns it in the vote data) and ProPublica requires that.