jbearer / MusicHack

Virtual jukebox for the Spring '16 5c Hackathon
0 stars 0 forks source link

Updating coin counts on upvote/downvote #1

Closed hmc-cs-jbearer closed 8 years ago

hmc-cs-jbearer commented 8 years ago

The way I have it right now, the only thing that happens when a user upvotes is that they add themselves to a list of people who upvoted the current song. The coin count for the requester of the song is not updated, and we can't update it from the front end very easily, because this would be subject to exploits whereby users change the algorithm for increasing/decreasing the count.

Proposed solution: we implement a backend app that interfaces with Firebase independently of the client-side code. The backend app watches for changes in the list of upvoters and downvoters and changes the coin counts accordingly. When the coin count changes, the client code is notified and updates the interface, but this way the secure data (ie the coin count) is only being edited from a secure source (the server).