JayThomason / Tutti

Tutti is a shared music application for the car being made in conjunction with Audi.
3 stars 1 forks source link

Bugfix: "Now playing" song is displayed incorrectly (but still sync'd) after concurrent drag-and-drops #209

Closed hwray closed 10 years ago

hwray commented 10 years ago

When two or three phones drag-and-drop at the same time, the song shown as "Now playing" often gets messed up and no longer corresponds to the currently-playing song. Thankfully, all the phones stay sync'd and at least show the same incorrect song as currently-playing, so this is hopefully a code error rather than a concurrency error and shouldn't be terrible to fix.

hwray commented 10 years ago

I've got this fixed now. Even though we started using the jam song ID and "to" index as our parameters for the drag-and-drop moves, we were still relying on the "from" index to do the reordering of the current song index, ignoring the fact that the remote "from" index that was passed could have already been invalidated by a concurrent change on another phone.

Everything seems to be staying in sync now!!!